| Index: jdmarker.c
 | 
| ===================================================================
 | 
| --- jdmarker.c	(revision 136524)
 | 
| +++ jdmarker.c	(working copy)
 | 
| @@ -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;
 | 
| 
 |