OLD | NEW |
1 /* | 1 /* |
2 * jdmarker.c | 2 * jdmarker.c |
3 * | 3 * |
4 * Copyright (C) 1991-1998, Thomas G. Lane. | 4 * Copyright (C) 1991-1998, Thomas G. Lane. |
5 * This file is part of the Independent JPEG Group's software. | 5 * This file is part of the Independent JPEG Group's software. |
6 * For conditions of distribution and use, see the accompanying README file. | 6 * For conditions of distribution and use, see the accompanying README file. |
7 * | 7 * |
8 * This file contains routines to decode JPEG datastream markers. | 8 * This file contains routines to decode JPEG datastream markers. |
9 * Most of the complexity arises from our desire to support input | 9 * Most of the complexity arises from our desire to support input |
10 * suspension: if not all of the data for a marker is available, | 10 * suspension: if not all of the data for a marker is available, |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc); | 335 ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc); |
336 | 336 |
337 id_found: | 337 id_found: |
338 | 338 |
339 cinfo->cur_comp_info[i] = compptr; | 339 cinfo->cur_comp_info[i] = compptr; |
340 compptr->dc_tbl_no = (c >> 4) & 15; | 340 compptr->dc_tbl_no = (c >> 4) & 15; |
341 compptr->ac_tbl_no = (c ) & 15; | 341 compptr->ac_tbl_no = (c ) & 15; |
342 | 342 |
343 TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc, | 343 TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc, |
344 compptr->dc_tbl_no, compptr->ac_tbl_no); | 344 compptr->dc_tbl_no, compptr->ac_tbl_no); |
345 | |
346 /* This CSi (cc) should differ from the previous CSi */ | |
347 for (ci = 0; ci < i; ci++) { | |
348 if (cinfo->cur_comp_info[ci] == compptr) | |
349 ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc); | |
350 } | |
351 } | 345 } |
352 | 346 |
353 /* Collect the additional scan parameters Ss, Se, Ah/Al. */ | 347 /* Collect the additional scan parameters Ss, Se, Ah/Al. */ |
354 INPUT_BYTE(cinfo, c, return FALSE); | 348 INPUT_BYTE(cinfo, c, return FALSE); |
355 cinfo->Ss = c; | 349 cinfo->Ss = c; |
356 INPUT_BYTE(cinfo, c, return FALSE); | 350 INPUT_BYTE(cinfo, c, return FALSE); |
357 cinfo->Se = c; | 351 cinfo->Se = c; |
358 INPUT_BYTE(cinfo, c, return FALSE); | 352 INPUT_BYTE(cinfo, c, return FALSE); |
359 cinfo->Ah = (c >> 4) & 15; | 353 cinfo->Ah = (c >> 4) & 15; |
360 cinfo->Al = (c ) & 15; | 354 cinfo->Al = (c ) & 15; |
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1357 { | 1351 { |
1358 my_marker_ptr marker = (my_marker_ptr) cinfo->marker; | 1352 my_marker_ptr marker = (my_marker_ptr) cinfo->marker; |
1359 | 1353 |
1360 if (marker_code == (int) M_COM) | 1354 if (marker_code == (int) M_COM) |
1361 marker->process_COM = routine; | 1355 marker->process_COM = routine; |
1362 else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15) | 1356 else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15) |
1363 marker->process_APPn[marker_code - (int) M_APP0] = routine; | 1357 marker->process_APPn[marker_code - (int) M_APP0] = routine; |
1364 else | 1358 else |
1365 ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code); | 1359 ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code); |
1366 } | 1360 } |
OLD | NEW |