tiff: Fix variable assignment
authorBenjamin Otte <otte@redhat.com>
Fri, 22 Oct 2021 18:45:27 +0000 (20:45 +0200)
committerBenjamin Otte <otte@redhat.com>
Fri, 22 Oct 2021 21:50:45 +0000 (23:50 +0200)
gdk/loaders/gdktiff.c

index 2652aeacc4fc67caf735091be20c2e2bb577e4ee..62e292a73d416861a8ca51a159ee5299d8008da3 100644 (file)
@@ -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);