diff options
author | dcommander <dcommander@3789f03b-4d11-0410-bbf8-ca57d06f2519> | 2012-01-27 01:23:20 +0000 |
---|---|---|
committer | dcommander <dcommander@3789f03b-4d11-0410-bbf8-ca57d06f2519> | 2012-01-27 01:23:20 +0000 |
commit | 9ecf8cef6bee902c599c05d4059a65e43939750b (patch) | |
tree | 7059619c0f8311684f6b5cd61ea87a16818df4a2 /trunk/jdmarker.c | |
parent | 00560c876b86240732263db849865941a1cde8fd (diff) |
Properly decompress erroneous CMYK/YCCK images whose K component has an ID of 1 instead of 4 (this is to support SumatraPDF)
git-svn-id: https://libjpeg-turbo.svn.sourceforge.net/svnroot/libjpeg-turbo@740 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'trunk/jdmarker.c')
-rw-r--r-- | trunk/jdmarker.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/trunk/jdmarker.c b/trunk/jdmarker.c index f4cca8c..beb2303 100644 --- a/trunk/jdmarker.c +++ b/trunk/jdmarker.c @@ -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; } |