summaryrefslogtreecommitdiffstats
path: root/third_party
diff options
context:
space:
mode:
authornoel@chromium.org <noel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-12 17:21:44 +0000
committernoel@chromium.org <noel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-12 17:21:44 +0000
commit9dc78e12f7d233c5279c779fe1135d0586275881 (patch)
treef9ca80fd5bbd571e8c6f8fe3425480ad9fe669c4 /third_party
parent575306862c9e7ee99992ca8e748a262b801b7ecb (diff)
downloadchromium_src-9dc78e12f7d233c5279c779fe1135d0586275881.zip
chromium_src-9dc78e12f7d233c5279c779fe1135d0586275881.tar.gz
chromium_src-9dc78e12f7d233c5279c779fe1135d0586275881.tar.bz2
Better handle SOS CSi values and order
Image SOS CSi markers should be distinct. Enforce that constraint when reading multiple CSi values in get_sos(). TBR=darin@chromium.org BUG=258723 Review URL: https://codereview.chromium.org/27008002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228354 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party')
-rw-r--r--third_party/libjpeg/README.chromium3
-rw-r--r--third_party/libjpeg/google.jdmarker.patch17
-rw-r--r--third_party/libjpeg/jdmarker.c6
3 files changed, 26 insertions, 0 deletions
diff --git a/third_party/libjpeg/README.chromium b/third_party/libjpeg/README.chromium
index 70ef475f..6b1aecc 100644
--- a/third_party/libjpeg/README.chromium
+++ b/third_party/libjpeg/README.chromium
@@ -20,3 +20,6 @@ along with all of the frontend files for doing utility programs.
We added a new file jpeglibmangler.h and included it from jpeglib.h that changes
the names of all externally visible functions to chromium_ijg_* so that we can
avoid conflicts that arise when system libraries attempt to use our libjpeg.
+
+Also patch in google.jdmarker.patch to better handle multiple SOS CSi values and
+their ordering.
diff --git a/third_party/libjpeg/google.jdmarker.patch b/third_party/libjpeg/google.jdmarker.patch
new file mode 100644
index 0000000..0a0c073
--- /dev/null
+++ b/third_party/libjpeg/google.jdmarker.patch
@@ -0,0 +1,17 @@
+diff --git a/third_party/libjpeg/jdmarker.c b/third_party/libjpeg/jdmarker.c
+index f4cca8c..c9325af 100644
+--- a/third_party/libjpeg/jdmarker.c
++++ b/third_party/libjpeg/jdmarker.c
+@@ -342,6 +342,12 @@ get_sos (j_decompress_ptr cinfo)
+
+ TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc,
+ compptr->dc_tbl_no, compptr->ac_tbl_no);
++
++ /* This CSi (cc) should differ from the previous CSi */
++ for (ci = 0; ci < i; ci++) {
++ if (cinfo->cur_comp_info[ci] == compptr)
++ ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc);
++ }
+ }
+
+ /* Collect the additional scan parameters Ss, Se, Ah/Al. */
diff --git a/third_party/libjpeg/jdmarker.c b/third_party/libjpeg/jdmarker.c
index f4cca8c..c9325af 100644
--- a/third_party/libjpeg/jdmarker.c
+++ b/third_party/libjpeg/jdmarker.c
@@ -342,6 +342,12 @@ get_sos (j_decompress_ptr cinfo)
TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc,
compptr->dc_tbl_no, compptr->ac_tbl_no);
+
+ /* This CSi (cc) should differ from the previous CSi */
+ for (ci = 0; ci < i; ci++) {
+ if (cinfo->cur_comp_info[ci] == compptr)
+ ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc);
+ }
}
/* Collect the additional scan parameters Ss, Se, Ah/Al. */