Author: abrander
Date: 2014-01-19 06:42:38 +0100 (Sun, 19 Jan 2014)
New Revision: 4428

Modified:
   trunk/plugins/meta-tiff/tiff-meta.c
Log:
Correctly detect jpeg end marker in ifd_panasonic() (Bug #621).

Modified: trunk/plugins/meta-tiff/tiff-meta.c
===================================================================
--- trunk/plugins/meta-tiff/tiff-meta.c 2014-01-19 05:25:51 UTC (rev 4427)
+++ trunk/plugins/meta-tiff/tiff-meta.c 2014-01-19 05:42:38 UTC (rev 4428)
@@ -1194,9 +1194,10 @@
                thumb_guess = 0;
                guchar* image = raw_get_map(rawfile) + meta->thumbnail_start;
                do {
-                       if (image[thumb_guess] == 0xff && image[thumb_guess] == 
0xd9)
+                       /* 0xff, 0xd9 is the JPEG "end of image" marker */ 
+                       if (image[thumb_guess] == 0xff && image[thumb_guess+1] 
== 0xd9)
                                meta->thumbnail_length = thumb_guess+2;
-               } while (thumb_guess++ < raw_get_filesize(rawfile) - 
meta->thumbnail_start);
+               } while (thumb_guess++ < raw_get_filesize(rawfile) - 
meta->thumbnail_start + 1);
        }
        return TRUE;
 }


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to