]> granicus.if.org Git - libjpeg-turbo/commitdiff
Properly decompress erroneous CMYK/YCCK images whose K component has an ID of 1 inste...
authorDRC <dcommander@users.sourceforge.net>
Fri, 27 Jan 2012 01:23:20 +0000 (01:23 +0000)
committerDRC <dcommander@users.sourceforge.net>
Fri, 27 Jan 2012 01:23:20 +0000 (01:23 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@740 632fc199-4ca6-4c93-a231-07263d6284db

ChangeLog.txt
jdmarker.c

index f7e0fc5e686232bc0969210fde2cefe257fec12f..f6b38d7b1b804fefa290f52cb1f2bf163b6f0bd5 100644 (file)
@@ -24,6 +24,11 @@ because libjpeg-turbo's distributed version of jconfig.h contained an INLINE
 macro, which conflicted with a similar macro in DevIL.  This macro is used only
 internally when building libjpeg-turbo, so it was moved into config.h.
 
+[6] libjpeg-turbo will now correctly decompress erroneous CMYK/YCCK JPEGs whose
+K component is assigned a component ID of 1 instead of 4.  Although these files
+are in violation of the spec, other JPEG implementations handle them
+correctly.
+
 
 1.1.90 (1.2 beta1)
 ==================
index f4cca8cc835c271ce14920ca790461ffc7ba4640..beb23035b724864fd3ecfdaecdcd588b08adb466 100644 (file)
@@ -2,6 +2,7 @@
  * jdmarker.c
  *
  * Copyright (C) 1991-1998, Thomas G. Lane.
+ * Copyright (C) 2012, D. R. Commander.
  * This file is part of the Independent JPEG Group's software.
  * For conditions of distribution and use, see the accompanying README file.
  *
@@ -322,13 +323,16 @@ get_sos (j_decompress_ptr cinfo)
 
   /* Collect the component-spec parameters */
 
+  for (i = 0; i < n; i++)
+    cinfo->cur_comp_info[i] = NULL;
+
   for (i = 0; i < n; i++) {
     INPUT_BYTE(cinfo, cc, return FALSE);
     INPUT_BYTE(cinfo, c, return FALSE);
     
     for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
         ci++, compptr++) {
-      if (cc == compptr->component_id)
+      if (cc == compptr->component_id && !cinfo->cur_comp_info[ci])
        goto id_found;
     }