[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58164] trunk/blender/source/blender/imbuf /intern/tiff.c: fix [#36089] crash when using a tiff without TIFFTAG_EXTRASAMPLES

Campbell Barton ideasman42 at gmail.com
Thu Jul 11 06:38:47 CEST 2013


Revision: 58164
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58164
Author:   campbellbarton
Date:     2013-07-11 04:38:47 +0000 (Thu, 11 Jul 2013)
Log Message:
-----------
fix [#36089] crash when using a tiff without TIFFTAG_EXTRASAMPLES

Modified Paths:
--------------
    trunk/blender/source/blender/imbuf/intern/tiff.c

Modified: trunk/blender/source/blender/imbuf/intern/tiff.c
===================================================================
--- trunk/blender/source/blender/imbuf/intern/tiff.c	2013-07-11 04:24:36 UTC (rev 58163)
+++ trunk/blender/source/blender/imbuf/intern/tiff.c	2013-07-11 04:38:47 UTC (rev 58164)
@@ -532,6 +532,7 @@
 	int level;
 	short spp;
 	int ib_depth;
+	int found;
 
 	/* check whether or not we have a TIFF file */
 	if (size < IMB_TIFF_NCB) {
@@ -575,10 +576,11 @@
 		if (spp == 4) {
 			unsigned short extra, *extraSampleTypes;
 
-			TIFFGetField(image, TIFFTAG_EXTRASAMPLES, &extra, &extraSampleTypes);
+			found = TIFFGetField(image, TIFFTAG_EXTRASAMPLES, &extra, &extraSampleTypes);
 
-			if (extraSampleTypes[0] == EXTRASAMPLE_ASSOCALPHA)
+			if (found && (extraSampleTypes[0] == EXTRASAMPLE_ASSOCALPHA)) {
 				ibuf->flags |= IB_alphamode_premul;
+			}
 		}
 	}
 




More information about the Bf-blender-cvs mailing list