Pull in r830 from upstream.

BUG=130240
Review URL: https://chromiumcodereview.appspot.com/10459034

git-svn-id: http://src.chromium.org/svn/trunk/deps/third_party/libjpeg_turbo@139642 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
diff --git a/README.chromium b/README.chromium
index cee676f..bbc3eba 100644
--- a/README.chromium
+++ b/README.chromium
@@ -6,7 +6,7 @@
 
 Description:
 This consists of three components:
-* A partial copy of libjpeg-turbo 1.2.80 (r829);
+* A partial copy of libjpeg-turbo 1.2.80 (r830);
 * A build file (libjpeg.gyp), and;
 * Patched header files used by Chromium.
 
diff --git a/jdmarker.c b/jdmarker.c
index 0cdb887..0d5da67 100644
--- a/jdmarker.c
+++ b/jdmarker.c
@@ -323,14 +323,15 @@
 
   /* Collect the component-spec parameters */
 
-  for (i = 0; i < cinfo->num_components; i++)
+  for (i = 0; i < MAX_COMPS_IN_SCAN; 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;
+    for (ci = 0, compptr = cinfo->comp_info;
+	 ci < cinfo->num_components && ci < MAX_COMPS_IN_SCAN;
 	 ci++, compptr++) {
       if (cc == compptr->component_id && !cinfo->cur_comp_info[ci])
 	goto id_found;