[gdk-pixbuf] jpeg: Use a temporary variable



commit fa472afe93ecf4a1863d4fcbe79cccad5a613faf
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Dec 5 06:21:08 2017 +0100

    jpeg: Use a temporary variable
    
    To avoid using context->cinfo all the time.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=753605

 gdk-pixbuf/io-jpeg.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c
index 23284a7..1e7fcd0 100644
--- a/gdk-pixbuf/io-jpeg.c
+++ b/gdk-pixbuf/io-jpeg.c
@@ -842,9 +842,12 @@ static gboolean
 gdk_pixbuf__jpeg_image_stop_load (gpointer data, GError **error)
 {
        JpegProgContext *context = (JpegProgContext *) data;
+       struct           jpeg_decompress_struct *cinfo;
         gboolean retval;
 
        g_return_val_if_fail (context != NULL, TRUE);
+
+       cinfo = &context->cinfo;
        
         /* FIXME this thing needs to report errors if
          * we have unused image data
@@ -857,16 +860,16 @@ gdk_pixbuf__jpeg_image_stop_load (gpointer data, GError **error)
        context->jerr.error = error;
        if (sigsetjmp (context->jerr.setjmp_buffer, 1)) {
                 retval = FALSE;
+                g_message ("do we have an error?");
        } else {
-               jpeg_finish_decompress (&context->cinfo);
+               jpeg_finish_decompress (cinfo);
                 retval = TRUE;
        }
 
         jpeg_destroy_decompress (&context->cinfo);
 
-       if (context->cinfo.src) {
-               my_src_ptr src = (my_src_ptr) context->cinfo.src;
-               
+       if (cinfo->src) {
+               my_src_ptr src = (my_src_ptr) cinfo->src;
                g_free (src);
        }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]