[gtk/wip/otte/for-master: 1/4] tiff: Fix variable assignment




commit b2f9a907cef414a1bc0d1c64f910b3cf4736dd07
Author: Benjamin Otte <otte redhat com>
Date:   Fri Oct 22 20:45:27 2021 +0200

    tiff: Fix variable assignment

 gdk/loaders/gdktiff.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gdk/loaders/gdktiff.c b/gdk/loaders/gdktiff.c
index 2652aeacc4..62e292a73d 100644
--- a/gdk/loaders/gdktiff.c
+++ b/gdk/loaders/gdktiff.c
@@ -393,10 +393,11 @@ gdk_load_tiff (GBytes  *input_bytes,
       guint16 extra;
       guint16 *extra_types;
 
-      if (!TIFFGetField (tif, TIFFTAG_EXTRASAMPLES, &extra, &extra_types))
+      if (TIFFGetField (tif, TIFFTAG_EXTRASAMPLES, &extra, &extra_types))
+        alpha_samples = extra_types[0];
+      else
         alpha_samples = 0;
 
-      alpha_samples = extra_types[0];
       if (alpha_samples != 0 && alpha_samples != EXTRASAMPLE_ASSOCALPHA && alpha_samples != 
EXTRASAMPLE_UNASSALPHA)
         {
           texture = load_fallback (tif, error);


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