Index: jdmarker.c |
diff --git a/jdmarker.c b/jdmarker.c |
index c8cf9a46559d4dbdd8d15f8f719dd3c197b2125a..e3b612c9b9d712b10407c1677019867f6087bbc9 100644 |
--- a/jdmarker.c |
+++ b/jdmarker.c |
@@ -4,8 +4,9 @@ |
* This file was part of the Independent JPEG Group's software: |
* Copyright (C) 1991-1998, Thomas G. Lane. |
* libjpeg-turbo Modifications: |
- * Copyright (C) 2012, D. R. Commander. |
- * For conditions of distribution and use, see the accompanying README file. |
+ * Copyright (C) 2012, 2015, D. R. Commander. |
+ * For conditions of distribution and use, see the accompanying README.ijg |
+ * file. |
* |
* This file contains routines to decode JPEG datastream markers. |
* Most of the complexity arises from our desire to support input |
@@ -19,29 +20,29 @@ |
#include "jpeglib.h" |
-typedef enum { /* JPEG marker codes */ |
+typedef enum { /* JPEG marker codes */ |
M_SOF0 = 0xc0, |
M_SOF1 = 0xc1, |
M_SOF2 = 0xc2, |
M_SOF3 = 0xc3, |
- |
+ |
M_SOF5 = 0xc5, |
M_SOF6 = 0xc6, |
M_SOF7 = 0xc7, |
- |
+ |
M_JPG = 0xc8, |
M_SOF9 = 0xc9, |
M_SOF10 = 0xca, |
M_SOF11 = 0xcb, |
- |
+ |
M_SOF13 = 0xcd, |
M_SOF14 = 0xce, |
M_SOF15 = 0xcf, |
- |
+ |
M_DHT = 0xc4, |
- |
+ |
M_DAC = 0xcc, |
- |
+ |
M_RST0 = 0xd0, |
M_RST1 = 0xd1, |
M_RST2 = 0xd2, |
@@ -50,7 +51,7 @@ typedef enum { /* JPEG marker codes */ |
M_RST5 = 0xd5, |
M_RST6 = 0xd6, |
M_RST7 = 0xd7, |
- |
+ |
M_SOI = 0xd8, |
M_EOI = 0xd9, |
M_SOS = 0xda, |
@@ -59,7 +60,7 @@ typedef enum { /* JPEG marker codes */ |
M_DRI = 0xdd, |
M_DHP = 0xde, |
M_EXP = 0xdf, |
- |
+ |
M_APP0 = 0xe0, |
M_APP1 = 0xe1, |
M_APP2 = 0xe2, |
@@ -76,13 +77,13 @@ typedef enum { /* JPEG marker codes */ |
M_APP13 = 0xed, |
M_APP14 = 0xee, |
M_APP15 = 0xef, |
- |
+ |
M_JPG0 = 0xf0, |
M_JPG13 = 0xfd, |
M_COM = 0xfe, |
- |
+ |
M_TEM = 0x01, |
- |
+ |
M_ERROR = 0x100 |
} JPEG_MARKER; |
@@ -101,12 +102,12 @@ typedef struct { |
unsigned int length_limit_APPn[16]; |
/* Status of COM/APPn marker saving */ |
- jpeg_saved_marker_ptr cur_marker; /* NULL if not processing a marker */ |
- unsigned int bytes_read; /* data bytes read so far in marker */ |
+ jpeg_saved_marker_ptr cur_marker; /* NULL if not processing a marker */ |
+ unsigned int bytes_read; /* data bytes read so far in marker */ |
/* Note: cur_marker is not linked into marker_list until it's all read. */ |
} my_marker_reader; |
-typedef my_marker_reader * my_marker_ptr; |
+typedef my_marker_reader *my_marker_ptr; |
/* |
@@ -119,49 +120,49 @@ typedef my_marker_reader * my_marker_ptr; |
/* Declare and initialize local copies of input pointer/count */ |
#define INPUT_VARS(cinfo) \ |
- struct jpeg_source_mgr * datasrc = (cinfo)->src; \ |
- const JOCTET * next_input_byte = datasrc->next_input_byte; \ |
- size_t bytes_in_buffer = datasrc->bytes_in_buffer |
+ struct jpeg_source_mgr *datasrc = (cinfo)->src; \ |
+ const JOCTET *next_input_byte = datasrc->next_input_byte; \ |
+ size_t bytes_in_buffer = datasrc->bytes_in_buffer |
/* Unload the local copies --- do this only at a restart boundary */ |
#define INPUT_SYNC(cinfo) \ |
- ( datasrc->next_input_byte = next_input_byte, \ |
- datasrc->bytes_in_buffer = bytes_in_buffer ) |
+ ( datasrc->next_input_byte = next_input_byte, \ |
+ datasrc->bytes_in_buffer = bytes_in_buffer ) |
/* Reload the local copies --- used only in MAKE_BYTE_AVAIL */ |
#define INPUT_RELOAD(cinfo) \ |
- ( next_input_byte = datasrc->next_input_byte, \ |
- bytes_in_buffer = datasrc->bytes_in_buffer ) |
+ ( next_input_byte = datasrc->next_input_byte, \ |
+ bytes_in_buffer = datasrc->bytes_in_buffer ) |
/* Internal macro for INPUT_BYTE and INPUT_2BYTES: make a byte available. |
* Note we do *not* do INPUT_SYNC before calling fill_input_buffer, |
* but we must reload the local copies after a successful fill. |
*/ |
#define MAKE_BYTE_AVAIL(cinfo,action) \ |
- if (bytes_in_buffer == 0) { \ |
- if (! (*datasrc->fill_input_buffer) (cinfo)) \ |
- { action; } \ |
- INPUT_RELOAD(cinfo); \ |
- } |
+ if (bytes_in_buffer == 0) { \ |
+ if (! (*datasrc->fill_input_buffer) (cinfo)) \ |
+ { action; } \ |
+ INPUT_RELOAD(cinfo); \ |
+ } |
/* Read a byte into variable V. |
* If must suspend, take the specified action (typically "return FALSE"). |
*/ |
#define INPUT_BYTE(cinfo,V,action) \ |
- MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \ |
- bytes_in_buffer--; \ |
- V = GETJOCTET(*next_input_byte++); ) |
+ MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \ |
+ bytes_in_buffer--; \ |
+ V = GETJOCTET(*next_input_byte++); ) |
/* As above, but read two bytes interpreted as an unsigned 16-bit integer. |
- * V should be declared unsigned int or perhaps INT32. |
+ * V should be declared unsigned int or perhaps JLONG. |
*/ |
#define INPUT_2BYTES(cinfo,V,action) \ |
- MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \ |
- bytes_in_buffer--; \ |
- V = ((unsigned int) GETJOCTET(*next_input_byte++)) << 8; \ |
- MAKE_BYTE_AVAIL(cinfo,action); \ |
- bytes_in_buffer--; \ |
- V += GETJOCTET(*next_input_byte++); ) |
+ MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \ |
+ bytes_in_buffer--; \ |
+ V = ((unsigned int) GETJOCTET(*next_input_byte++)) << 8; \ |
+ MAKE_BYTE_AVAIL(cinfo,action); \ |
+ bytes_in_buffer--; \ |
+ V += GETJOCTET(*next_input_byte++); ) |
/* |
@@ -200,7 +201,7 @@ get_soi (j_decompress_ptr cinfo) |
/* Process an SOI marker */ |
{ |
int i; |
- |
+ |
TRACEMS(cinfo, 1, JTRC_SOI); |
if (cinfo->marker->saw_SOI) |
@@ -239,9 +240,9 @@ LOCAL(boolean) |
get_sof (j_decompress_ptr cinfo, boolean is_prog, boolean is_arith) |
/* Process a SOFn marker */ |
{ |
- INT32 length; |
+ JLONG length; |
int c, ci; |
- jpeg_component_info * compptr; |
+ jpeg_component_info *compptr; |
INPUT_VARS(cinfo); |
cinfo->progressive_mode = is_prog; |
@@ -257,8 +258,8 @@ get_sof (j_decompress_ptr cinfo, boolean is_prog, boolean is_arith) |
length -= 8; |
TRACEMS4(cinfo, 1, JTRC_SOF, cinfo->unread_marker, |
- (int) cinfo->image_width, (int) cinfo->image_height, |
- cinfo->num_components); |
+ (int) cinfo->image_width, (int) cinfo->image_height, |
+ cinfo->num_components); |
if (cinfo->marker->saw_SOF) |
ERREXIT(cinfo, JERR_SOF_DUPLICATE); |
@@ -273,11 +274,11 @@ get_sof (j_decompress_ptr cinfo, boolean is_prog, boolean is_arith) |
if (length != (cinfo->num_components * 3)) |
ERREXIT(cinfo, JERR_BAD_LENGTH); |
- if (cinfo->comp_info == NULL) /* do only once, even if suspend */ |
+ if (cinfo->comp_info == NULL) /* do only once, even if suspend */ |
cinfo->comp_info = (jpeg_component_info *) (*cinfo->mem->alloc_small) |
- ((j_common_ptr) cinfo, JPOOL_IMAGE, |
- cinfo->num_components * SIZEOF(jpeg_component_info)); |
- |
+ ((j_common_ptr) cinfo, JPOOL_IMAGE, |
+ cinfo->num_components * sizeof(jpeg_component_info)); |
+ |
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; |
ci++, compptr++) { |
compptr->component_index = ci; |
@@ -288,8 +289,8 @@ get_sof (j_decompress_ptr cinfo, boolean is_prog, boolean is_arith) |
INPUT_BYTE(cinfo, compptr->quant_tbl_no, return FALSE); |
TRACEMS4(cinfo, 1, JTRC_SOF_COMPONENT, |
- compptr->component_id, compptr->h_samp_factor, |
- compptr->v_samp_factor, compptr->quant_tbl_no); |
+ compptr->component_id, compptr->h_samp_factor, |
+ compptr->v_samp_factor, compptr->quant_tbl_no); |
} |
cinfo->marker->saw_SOF = TRUE; |
@@ -303,9 +304,9 @@ LOCAL(boolean) |
get_sos (j_decompress_ptr cinfo) |
/* Process a SOS marker */ |
{ |
- INT32 length; |
+ JLONG length; |
int i, ci, n, c, cc, pi; |
- jpeg_component_info * compptr; |
+ jpeg_component_info *compptr; |
INPUT_VARS(cinfo); |
if (! cinfo->marker->saw_SOF) |
@@ -330,12 +331,12 @@ get_sos (j_decompress_ptr cinfo) |
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 < MAX_COMPS_IN_SCAN; |
- ci++, compptr++) { |
+ ci < cinfo->num_components && ci < MAX_COMPS_IN_SCAN; |
+ ci++, compptr++) { |
if (cc == compptr->component_id && !cinfo->cur_comp_info[ci]) |
- goto id_found; |
+ goto id_found; |
} |
ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc); |
@@ -345,9 +346,9 @@ get_sos (j_decompress_ptr cinfo) |
cinfo->cur_comp_info[i] = compptr; |
compptr->dc_tbl_no = (c >> 4) & 15; |
compptr->ac_tbl_no = (c ) & 15; |
- |
+ |
TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc, |
- compptr->dc_tbl_no, compptr->ac_tbl_no); |
+ compptr->dc_tbl_no, compptr->ac_tbl_no); |
/* This CSi (cc) should differ from the previous CSi */ |
for (pi = 0; pi < i; pi++) { |
@@ -367,7 +368,7 @@ get_sos (j_decompress_ptr cinfo) |
cinfo->Al = (c ) & 15; |
TRACEMS4(cinfo, 1, JTRC_SOS_PARAMS, cinfo->Ss, cinfo->Se, |
- cinfo->Ah, cinfo->Al); |
+ cinfo->Ah, cinfo->Al); |
/* Prepare to scan data & restart markers */ |
cinfo->marker->next_restart_num = 0; |
@@ -386,13 +387,13 @@ LOCAL(boolean) |
get_dac (j_decompress_ptr cinfo) |
/* Process a DAC marker */ |
{ |
- INT32 length; |
+ JLONG length; |
int index, val; |
INPUT_VARS(cinfo); |
INPUT_2BYTES(cinfo, length, return FALSE); |
length -= 2; |
- |
+ |
while (length > 0) { |
INPUT_BYTE(cinfo, index, return FALSE); |
INPUT_BYTE(cinfo, val, return FALSE); |
@@ -406,11 +407,11 @@ get_dac (j_decompress_ptr cinfo) |
if (index >= NUM_ARITH_TBLS) { /* define AC table */ |
cinfo->arith_ac_K[index-NUM_ARITH_TBLS] = (UINT8) val; |
- } else { /* define DC table */ |
+ } else { /* define DC table */ |
cinfo->arith_dc_L[index] = (UINT8) (val & 0x0F); |
cinfo->arith_dc_U[index] = (UINT8) (val >> 4); |
if (cinfo->arith_dc_L[index] > cinfo->arith_dc_U[index]) |
- ERREXIT1(cinfo, JERR_DAC_VALUE, val); |
+ ERREXIT1(cinfo, JERR_DAC_VALUE, val); |
} |
} |
@@ -432,7 +433,7 @@ LOCAL(boolean) |
get_dht (j_decompress_ptr cinfo) |
/* Process a DHT marker */ |
{ |
- INT32 length; |
+ JLONG length; |
UINT8 bits[17]; |
UINT8 huffval[256]; |
int i, index, count; |
@@ -441,12 +442,12 @@ get_dht (j_decompress_ptr cinfo) |
INPUT_2BYTES(cinfo, length, return FALSE); |
length -= 2; |
- |
+ |
while (length > 16) { |
INPUT_BYTE(cinfo, index, return FALSE); |
TRACEMS1(cinfo, 1, JTRC_DHT, index); |
- |
+ |
bits[0] = 0; |
count = 0; |
for (i = 1; i <= 16; i++) { |
@@ -457,31 +458,31 @@ get_dht (j_decompress_ptr cinfo) |
length -= 1 + 16; |
TRACEMS8(cinfo, 2, JTRC_HUFFBITS, |
- bits[1], bits[2], bits[3], bits[4], |
- bits[5], bits[6], bits[7], bits[8]); |
+ bits[1], bits[2], bits[3], bits[4], |
+ bits[5], bits[6], bits[7], bits[8]); |
TRACEMS8(cinfo, 2, JTRC_HUFFBITS, |
- bits[9], bits[10], bits[11], bits[12], |
- bits[13], bits[14], bits[15], bits[16]); |
+ bits[9], bits[10], bits[11], bits[12], |
+ bits[13], bits[14], bits[15], bits[16]); |
/* Here we just do minimal validation of the counts to avoid walking |
* off the end of our table space. jdhuff.c will check more carefully. |
*/ |
- if (count > 256 || ((INT32) count) > length) |
+ if (count > 256 || ((JLONG) count) > length) |
ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); |
for (i = 0; i < count; i++) |
INPUT_BYTE(cinfo, huffval[i], return FALSE); |
- MEMZERO(&huffval[count], (256 - count) * SIZEOF(UINT8)); |
+ MEMZERO(&huffval[count], (256 - count) * sizeof(UINT8)); |
length -= count; |
- if (index & 0x10) { /* AC table definition */ |
+ if (index & 0x10) { /* AC table definition */ |
index -= 0x10; |
if (index < 0 || index >= NUM_HUFF_TBLS) |
ERREXIT1(cinfo, JERR_DHT_INDEX, index); |
htblptr = &cinfo->ac_huff_tbl_ptrs[index]; |
- } else { /* DC table definition */ |
+ } else { /* DC table definition */ |
if (index < 0 || index >= NUM_HUFF_TBLS) |
ERREXIT1(cinfo, JERR_DHT_INDEX, index); |
htblptr = &cinfo->dc_huff_tbl_ptrs[index]; |
@@ -489,9 +490,9 @@ get_dht (j_decompress_ptr cinfo) |
if (*htblptr == NULL) |
*htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); |
- |
- MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits)); |
- MEMCOPY((*htblptr)->huffval, huffval, SIZEOF((*htblptr)->huffval)); |
+ |
+ MEMCOPY((*htblptr)->bits, bits, sizeof((*htblptr)->bits)); |
+ MEMCOPY((*htblptr)->huffval, huffval, sizeof((*htblptr)->huffval)); |
} |
if (length != 0) |
@@ -506,7 +507,7 @@ LOCAL(boolean) |
get_dqt (j_decompress_ptr cinfo) |
/* Process a DQT marker */ |
{ |
- INT32 length; |
+ JLONG length; |
int n, i, prec; |
unsigned int tmp; |
JQUANT_TBL *quant_ptr; |
@@ -524,27 +525,27 @@ get_dqt (j_decompress_ptr cinfo) |
if (n >= NUM_QUANT_TBLS) |
ERREXIT1(cinfo, JERR_DQT_INDEX, n); |
- |
+ |
if (cinfo->quant_tbl_ptrs[n] == NULL) |
cinfo->quant_tbl_ptrs[n] = jpeg_alloc_quant_table((j_common_ptr) cinfo); |
quant_ptr = cinfo->quant_tbl_ptrs[n]; |
for (i = 0; i < DCTSIZE2; i++) { |
if (prec) |
- INPUT_2BYTES(cinfo, tmp, return FALSE); |
+ INPUT_2BYTES(cinfo, tmp, return FALSE); |
else |
- INPUT_BYTE(cinfo, tmp, return FALSE); |
+ INPUT_BYTE(cinfo, tmp, return FALSE); |
/* We convert the zigzag-order table to natural array order. */ |
quant_ptr->quantval[jpeg_natural_order[i]] = (UINT16) tmp; |
} |
if (cinfo->err->trace_level >= 2) { |
for (i = 0; i < DCTSIZE2; i += 8) { |
- TRACEMS8(cinfo, 2, JTRC_QUANTVALS, |
- quant_ptr->quantval[i], quant_ptr->quantval[i+1], |
- quant_ptr->quantval[i+2], quant_ptr->quantval[i+3], |
- quant_ptr->quantval[i+4], quant_ptr->quantval[i+5], |
- quant_ptr->quantval[i+6], quant_ptr->quantval[i+7]); |
+ TRACEMS8(cinfo, 2, JTRC_QUANTVALS, |
+ quant_ptr->quantval[i], quant_ptr->quantval[i+1], |
+ quant_ptr->quantval[i+2], quant_ptr->quantval[i+3], |
+ quant_ptr->quantval[i+4], quant_ptr->quantval[i+5], |
+ quant_ptr->quantval[i+6], quant_ptr->quantval[i+7]); |
} |
} |
@@ -564,12 +565,12 @@ LOCAL(boolean) |
get_dri (j_decompress_ptr cinfo) |
/* Process a DRI marker */ |
{ |
- INT32 length; |
+ JLONG length; |
unsigned int tmp; |
INPUT_VARS(cinfo); |
INPUT_2BYTES(cinfo, length, return FALSE); |
- |
+ |
if (length != 4) |
ERREXIT(cinfo, JERR_BAD_LENGTH); |
@@ -591,20 +592,20 @@ get_dri (j_decompress_ptr cinfo) |
* JFIF and Adobe markers, respectively. |
*/ |
-#define APP0_DATA_LEN 14 /* Length of interesting data in APP0 */ |
-#define APP14_DATA_LEN 12 /* Length of interesting data in APP14 */ |
-#define APPN_DATA_LEN 14 /* Must be the largest of the above!! */ |
+#define APP0_DATA_LEN 14 /* Length of interesting data in APP0 */ |
+#define APP14_DATA_LEN 12 /* Length of interesting data in APP14 */ |
+#define APPN_DATA_LEN 14 /* Must be the largest of the above!! */ |
LOCAL(void) |
-examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data, |
- unsigned int datalen, INT32 remaining) |
+examine_app0 (j_decompress_ptr cinfo, JOCTET *data, |
+ unsigned int datalen, JLONG remaining) |
/* Examine first few bytes from an APP0. |
* Take appropriate action if it is a JFIF marker. |
* datalen is # of bytes at data[], remaining is length of rest of marker data. |
*/ |
{ |
- INT32 totallen = (INT32) datalen + remaining; |
+ JLONG totallen = (JLONG) datalen + remaining; |
if (datalen >= APP0_DATA_LEN && |
GETJOCTET(data[0]) == 0x4A && |
@@ -627,18 +628,18 @@ examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data, |
*/ |
if (cinfo->JFIF_major_version != 1) |
WARNMS2(cinfo, JWRN_JFIF_MAJOR, |
- cinfo->JFIF_major_version, cinfo->JFIF_minor_version); |
+ cinfo->JFIF_major_version, cinfo->JFIF_minor_version); |
/* Generate trace messages */ |
TRACEMS5(cinfo, 1, JTRC_JFIF, |
- cinfo->JFIF_major_version, cinfo->JFIF_minor_version, |
- cinfo->X_density, cinfo->Y_density, cinfo->density_unit); |
+ cinfo->JFIF_major_version, cinfo->JFIF_minor_version, |
+ cinfo->X_density, cinfo->Y_density, cinfo->density_unit); |
/* Validate thumbnail dimensions and issue appropriate messages */ |
if (GETJOCTET(data[12]) | GETJOCTET(data[13])) |
TRACEMS2(cinfo, 1, JTRC_JFIF_THUMBNAIL, |
- GETJOCTET(data[12]), GETJOCTET(data[13])); |
+ GETJOCTET(data[12]), GETJOCTET(data[13])); |
totallen -= APP0_DATA_LEN; |
if (totallen != |
- ((INT32)GETJOCTET(data[12]) * (INT32)GETJOCTET(data[13]) * (INT32) 3)) |
+ ((JLONG)GETJOCTET(data[12]) * (JLONG)GETJOCTET(data[13]) * (JLONG) 3)) |
TRACEMS1(cinfo, 1, JTRC_JFIF_BADTHUMBNAILSIZE, (int) totallen); |
} else if (datalen >= 6 && |
GETJOCTET(data[0]) == 0x4A && |
@@ -662,7 +663,7 @@ examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data, |
break; |
default: |
TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION, |
- GETJOCTET(data[5]), (int) totallen); |
+ GETJOCTET(data[5]), (int) totallen); |
break; |
} |
} else { |
@@ -673,8 +674,8 @@ examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data, |
LOCAL(void) |
-examine_app14 (j_decompress_ptr cinfo, JOCTET FAR * data, |
- unsigned int datalen, INT32 remaining) |
+examine_app14 (j_decompress_ptr cinfo, JOCTET *data, |
+ unsigned int datalen, JLONG remaining) |
/* Examine first few bytes from an APP14. |
* Take appropriate action if it is an Adobe marker. |
* datalen is # of bytes at data[], remaining is length of rest of marker data. |
@@ -707,7 +708,7 @@ METHODDEF(boolean) |
get_interesting_appn (j_decompress_ptr cinfo) |
/* Process an APP0 or APP14 marker without saving it */ |
{ |
- INT32 length; |
+ JLONG length; |
JOCTET b[APPN_DATA_LEN]; |
unsigned int i, numtoread; |
INPUT_VARS(cinfo); |
@@ -729,10 +730,10 @@ get_interesting_appn (j_decompress_ptr cinfo) |
/* process it */ |
switch (cinfo->unread_marker) { |
case M_APP0: |
- examine_app0(cinfo, (JOCTET FAR *) b, numtoread, length); |
+ examine_app0(cinfo, (JOCTET *) b, numtoread, length); |
break; |
case M_APP14: |
- examine_app14(cinfo, (JOCTET FAR *) b, numtoread, length); |
+ examine_app14(cinfo, (JOCTET *) b, numtoread, length); |
break; |
default: |
/* can't get here unless jpeg_save_markers chooses wrong processor */ |
@@ -758,33 +759,33 @@ save_marker (j_decompress_ptr cinfo) |
my_marker_ptr marker = (my_marker_ptr) cinfo->marker; |
jpeg_saved_marker_ptr cur_marker = marker->cur_marker; |
unsigned int bytes_read, data_length; |
- JOCTET FAR * data; |
- INT32 length = 0; |
+ JOCTET *data; |
+ JLONG length = 0; |
INPUT_VARS(cinfo); |
if (cur_marker == NULL) { |
/* begin reading a marker */ |
INPUT_2BYTES(cinfo, length, return FALSE); |
length -= 2; |
- if (length >= 0) { /* watch out for bogus length word */ |
+ if (length >= 0) { /* watch out for bogus length word */ |
/* figure out how much we want to save */ |
unsigned int limit; |
if (cinfo->unread_marker == (int) M_COM) |
- limit = marker->length_limit_COM; |
+ limit = marker->length_limit_COM; |
else |
- limit = marker->length_limit_APPn[cinfo->unread_marker - (int) M_APP0]; |
+ limit = marker->length_limit_APPn[cinfo->unread_marker - (int) M_APP0]; |
if ((unsigned int) length < limit) |
- limit = (unsigned int) length; |
+ limit = (unsigned int) length; |
/* allocate and initialize the marker item */ |
cur_marker = (jpeg_saved_marker_ptr) |
- (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, |
- SIZEOF(struct jpeg_marker_struct) + limit); |
+ (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, |
+ sizeof(struct jpeg_marker_struct) + limit); |
cur_marker->next = NULL; |
cur_marker->marker = (UINT8) cinfo->unread_marker; |
cur_marker->original_length = (unsigned int) length; |
cur_marker->data_length = limit; |
/* data area is just beyond the jpeg_marker_struct */ |
- data = cur_marker->data = (JOCTET FAR *) (cur_marker + 1); |
+ data = cur_marker->data = (JOCTET *) (cur_marker + 1); |
marker->cur_marker = cur_marker; |
marker->bytes_read = 0; |
bytes_read = 0; |
@@ -802,7 +803,7 @@ save_marker (j_decompress_ptr cinfo) |
} |
while (bytes_read < data_length) { |
- INPUT_SYNC(cinfo); /* move the restart point to here */ |
+ INPUT_SYNC(cinfo); /* move the restart point to here */ |
marker->bytes_read = bytes_read; |
/* If there's not at least one byte in buffer, suspend */ |
MAKE_BYTE_AVAIL(cinfo, return FALSE); |
@@ -815,14 +816,14 @@ save_marker (j_decompress_ptr cinfo) |
} |
/* Done reading what we want to read */ |
- if (cur_marker != NULL) { /* will be NULL if bogus length word */ |
+ if (cur_marker != NULL) { /* will be NULL if bogus length word */ |
/* Add new marker to end of list */ |
if (cinfo->marker_list == NULL) { |
cinfo->marker_list = cur_marker; |
} else { |
jpeg_saved_marker_ptr prev = cinfo->marker_list; |
while (prev->next != NULL) |
- prev = prev->next; |
+ prev = prev->next; |
prev->next = cur_marker; |
} |
/* Reset pointer & calc remaining data length */ |
@@ -842,12 +843,12 @@ save_marker (j_decompress_ptr cinfo) |
break; |
default: |
TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, |
- (int) (data_length + length)); |
+ (int) (data_length + length)); |
break; |
} |
/* skip any remaining data -- could be lots */ |
- INPUT_SYNC(cinfo); /* do before skip_input_data */ |
+ INPUT_SYNC(cinfo); /* do before skip_input_data */ |
if (length > 0) |
(*cinfo->src->skip_input_data) (cinfo, (long) length); |
@@ -861,15 +862,15 @@ METHODDEF(boolean) |
skip_variable (j_decompress_ptr cinfo) |
/* Skip over an unknown or uninteresting variable-length marker */ |
{ |
- INT32 length; |
+ JLONG length; |
INPUT_VARS(cinfo); |
INPUT_2BYTES(cinfo, length, return FALSE); |
length -= 2; |
- |
+ |
TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, (int) length); |
- INPUT_SYNC(cinfo); /* do before skip_input_data */ |
+ INPUT_SYNC(cinfo); /* do before skip_input_data */ |
if (length > 0) |
(*cinfo->src->skip_input_data) (cinfo, (long) length); |
@@ -913,7 +914,7 @@ next_marker (j_decompress_ptr cinfo) |
INPUT_BYTE(cinfo, c, return FALSE); |
} while (c == 0xFF); |
if (c != 0) |
- break; /* found a valid marker, exit loop */ |
+ break; /* found a valid marker, exit loop */ |
/* Reach here if we found a stuffed-zero data sequence (FF/00). |
* Discard it and loop back to try again. |
*/ |
@@ -922,7 +923,7 @@ next_marker (j_decompress_ptr cinfo) |
} |
if (cinfo->marker->discarded_bytes != 0) { |
- TRACEMS2(cinfo, 1, JWRN_EXTRANEOUS_DATA, cinfo->marker->discarded_bytes, c); |
+ WARNMS2(cinfo, JWRN_EXTRANEOUS_DATA, cinfo->marker->discarded_bytes, c); |
cinfo->marker->discarded_bytes = 0; |
} |
@@ -956,143 +957,6 @@ first_marker (j_decompress_ptr cinfo) |
return TRUE; |
} |
-#ifdef MOTION_JPEG_SUPPORTED |
- |
-/* The default Huffman tables used by motion JPEG frames. When a motion JPEG |
- * frame does not have DHT tables, we should use the huffman tables suggested by |
- * the JPEG standard. Each of these tables represents a member of the JHUFF_TBLS |
- * struct so we can just copy it to the according JHUFF_TBLS member. |
- */ |
-/* DC table 0 */ |
-LOCAL(const unsigned char) mjpg_dc0_bits[] = { |
- 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, |
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 |
-}; |
- |
-LOCAL(const unsigned char) mjpg_dc0_huffval[] = { |
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, |
- 0x08, 0x09, 0x0A, 0x0B |
-}; |
- |
-/* DC table 1 */ |
-LOCAL(const unsigned char) mjpg_dc1_bits[] = { |
- 0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, |
- 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 |
-}; |
- |
-LOCAL(const unsigned char) mjpg_dc1_huffval[] = { |
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, |
- 0x08, 0x09, 0x0A, 0x0B |
-}; |
- |
-/* AC table 0 */ |
-LOCAL(const unsigned char) mjpg_ac0_bits[] = { |
- 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03, |
- 0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7D |
-}; |
- |
-LOCAL(const unsigned char) mjpg_ac0_huffval[] = { |
- 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, |
- 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, |
- 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xA1, 0x08, |
- 0x23, 0x42, 0xB1, 0xC1, 0x15, 0x52, 0xD1, 0xF0, |
- 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0A, 0x16, |
- 0x17, 0x18, 0x19, 0x1A, 0x25, 0x26, 0x27, 0x28, |
- 0x29, 0x2A, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, |
- 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, |
- 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, |
- 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, |
- 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, |
- 0x7A, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, |
- 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, |
- 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, |
- 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, |
- 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, |
- 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, |
- 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE1, 0xE2, |
- 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, |
- 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, |
- 0xF9, 0xFA |
-}; |
- |
-/* AC table 1 */ |
-LOCAL(const unsigned char) mjpg_ac1_bits[] = { |
- 0x00, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, |
- 0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77 |
-}; |
- |
-LOCAL(const unsigned char) mjpg_ac1_huffval[] = { |
- 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, |
- 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, |
- 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, |
- 0xA1, 0xB1, 0xC1, 0x09, 0x23, 0x33, 0x52, 0xF0, |
- 0x15, 0x62, 0x72, 0xD1, 0x0A, 0x16, 0x24, 0x34, |
- 0xE1, 0x25, 0xF1, 0x17, 0x18, 0x19, 0x1A, 0x26, |
- 0x27, 0x28, 0x29, 0x2A, 0x35, 0x36, 0x37, 0x38, |
- 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, |
- 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, |
- 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, |
- 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, |
- 0x79, 0x7A, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, |
- 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, |
- 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, |
- 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, |
- 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, |
- 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, |
- 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, |
- 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, |
- 0xEA, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, |
- 0xF9, 0xFA |
-}; |
- |
-/* Loads the default Huffman tables used by motion JPEG frames. This function |
- * just copies the huffman tables suggested in the JPEG standard when we have |
- * not load them. |
- */ |
-LOCAL(void) |
-mjpg_load_huff_tables (j_decompress_ptr cinfo) |
-{ |
- JHUFF_TBL *htblptr; |
- |
- if (! cinfo->dc_huff_tbl_ptrs[0]) { |
- htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); |
- MEMZERO(htblptr, SIZEOF(JHUFF_TBL)); |
- MEMCOPY(&htblptr->bits[1], mjpg_dc0_bits, SIZEOF(mjpg_dc0_bits)); |
- MEMCOPY(&htblptr->huffval[0], mjpg_dc0_huffval, SIZEOF(mjpg_dc0_huffval)); |
- cinfo->dc_huff_tbl_ptrs[0] = htblptr; |
- } |
- |
- if (! cinfo->dc_huff_tbl_ptrs[1]) { |
- htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); |
- MEMZERO(htblptr, SIZEOF(JHUFF_TBL)); |
- MEMCOPY(&htblptr->bits[1], mjpg_dc1_bits, SIZEOF(mjpg_dc1_bits)); |
- MEMCOPY(&htblptr->huffval[0], mjpg_dc1_huffval, SIZEOF(mjpg_dc1_huffval)); |
- cinfo->dc_huff_tbl_ptrs[1] = htblptr; |
- } |
- |
- if (! cinfo->ac_huff_tbl_ptrs[0]) { |
- htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); |
- MEMZERO(htblptr, SIZEOF(JHUFF_TBL)); |
- MEMCOPY(&htblptr->bits[1], mjpg_ac0_bits, SIZEOF(mjpg_ac0_bits)); |
- MEMCOPY(&htblptr->huffval[0], mjpg_ac0_huffval, SIZEOF(mjpg_ac0_huffval)); |
- cinfo->ac_huff_tbl_ptrs[0] = htblptr; |
- } |
- |
- if (! cinfo->ac_huff_tbl_ptrs[1]) { |
- htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); |
- MEMZERO(htblptr, SIZEOF(JHUFF_TBL)); |
- MEMCOPY(&htblptr->bits[1], mjpg_ac1_bits, SIZEOF(mjpg_ac1_bits)); |
- MEMCOPY(&htblptr->huffval[0], mjpg_ac1_huffval, SIZEOF(mjpg_ac1_huffval)); |
- cinfo->ac_huff_tbl_ptrs[1] = htblptr; |
- } |
-} |
- |
-#else |
- |
-#define mjpg_load_huff_tables(cinfo) |
- |
-#endif /* MOTION_JPEG_SUPPORTED */ |
- |
/* |
* Read markers until SOS or EOI. |
@@ -1110,11 +974,11 @@ read_markers (j_decompress_ptr cinfo) |
/* NB: first_marker() enforces the requirement that SOI appear first. */ |
if (cinfo->unread_marker == 0) { |
if (! cinfo->marker->saw_SOI) { |
- if (! first_marker(cinfo)) |
- return JPEG_SUSPENDED; |
+ if (! first_marker(cinfo)) |
+ return JPEG_SUSPENDED; |
} else { |
- if (! next_marker(cinfo)) |
- return JPEG_SUSPENDED; |
+ if (! next_marker(cinfo)) |
+ return JPEG_SUSPENDED; |
} |
} |
/* At this point cinfo->unread_marker contains the marker code and the |
@@ -1124,75 +988,74 @@ read_markers (j_decompress_ptr cinfo) |
switch (cinfo->unread_marker) { |
case M_SOI: |
if (! get_soi(cinfo)) |
- return JPEG_SUSPENDED; |
+ return JPEG_SUSPENDED; |
break; |
- case M_SOF0: /* Baseline */ |
- case M_SOF1: /* Extended sequential, Huffman */ |
+ case M_SOF0: /* Baseline */ |
+ case M_SOF1: /* Extended sequential, Huffman */ |
if (! get_sof(cinfo, FALSE, FALSE)) |
- return JPEG_SUSPENDED; |
+ return JPEG_SUSPENDED; |
break; |
- case M_SOF2: /* Progressive, Huffman */ |
+ case M_SOF2: /* Progressive, Huffman */ |
if (! get_sof(cinfo, TRUE, FALSE)) |
- return JPEG_SUSPENDED; |
+ return JPEG_SUSPENDED; |
break; |
- case M_SOF9: /* Extended sequential, arithmetic */ |
+ case M_SOF9: /* Extended sequential, arithmetic */ |
if (! get_sof(cinfo, FALSE, TRUE)) |
- return JPEG_SUSPENDED; |
+ return JPEG_SUSPENDED; |
break; |
- case M_SOF10: /* Progressive, arithmetic */ |
+ case M_SOF10: /* Progressive, arithmetic */ |
if (! get_sof(cinfo, TRUE, TRUE)) |
- return JPEG_SUSPENDED; |
+ return JPEG_SUSPENDED; |
break; |
/* Currently unsupported SOFn types */ |
- case M_SOF3: /* Lossless, Huffman */ |
- case M_SOF5: /* Differential sequential, Huffman */ |
- case M_SOF6: /* Differential progressive, Huffman */ |
- case M_SOF7: /* Differential lossless, Huffman */ |
- case M_JPG: /* Reserved for JPEG extensions */ |
- case M_SOF11: /* Lossless, arithmetic */ |
- case M_SOF13: /* Differential sequential, arithmetic */ |
- case M_SOF14: /* Differential progressive, arithmetic */ |
- case M_SOF15: /* Differential lossless, arithmetic */ |
+ case M_SOF3: /* Lossless, Huffman */ |
+ case M_SOF5: /* Differential sequential, Huffman */ |
+ case M_SOF6: /* Differential progressive, Huffman */ |
+ case M_SOF7: /* Differential lossless, Huffman */ |
+ case M_JPG: /* Reserved for JPEG extensions */ |
+ case M_SOF11: /* Lossless, arithmetic */ |
+ case M_SOF13: /* Differential sequential, arithmetic */ |
+ case M_SOF14: /* Differential progressive, arithmetic */ |
+ case M_SOF15: /* Differential lossless, arithmetic */ |
ERREXIT1(cinfo, JERR_SOF_UNSUPPORTED, cinfo->unread_marker); |
break; |
case M_SOS: |
- mjpg_load_huff_tables(cinfo); |
if (! get_sos(cinfo)) |
- return JPEG_SUSPENDED; |
- cinfo->unread_marker = 0; /* processed the marker */ |
+ return JPEG_SUSPENDED; |
+ cinfo->unread_marker = 0; /* processed the marker */ |
return JPEG_REACHED_SOS; |
- |
+ |
case M_EOI: |
TRACEMS(cinfo, 1, JTRC_EOI); |
- cinfo->unread_marker = 0; /* processed the marker */ |
+ cinfo->unread_marker = 0; /* processed the marker */ |
return JPEG_REACHED_EOI; |
- |
+ |
case M_DAC: |
if (! get_dac(cinfo)) |
- return JPEG_SUSPENDED; |
+ return JPEG_SUSPENDED; |
break; |
- |
+ |
case M_DHT: |
if (! get_dht(cinfo)) |
- return JPEG_SUSPENDED; |
+ return JPEG_SUSPENDED; |
break; |
- |
+ |
case M_DQT: |
if (! get_dqt(cinfo)) |
- return JPEG_SUSPENDED; |
+ return JPEG_SUSPENDED; |
break; |
- |
+ |
case M_DRI: |
if (! get_dri(cinfo)) |
- return JPEG_SUSPENDED; |
+ return JPEG_SUSPENDED; |
break; |
- |
+ |
case M_APP0: |
case M_APP1: |
case M_APP2: |
@@ -1210,16 +1073,16 @@ read_markers (j_decompress_ptr cinfo) |
case M_APP14: |
case M_APP15: |
if (! (*((my_marker_ptr) cinfo->marker)->process_APPn[ |
- cinfo->unread_marker - (int) M_APP0]) (cinfo)) |
- return JPEG_SUSPENDED; |
+ cinfo->unread_marker - (int) M_APP0]) (cinfo)) |
+ return JPEG_SUSPENDED; |
break; |
- |
+ |
case M_COM: |
if (! (*((my_marker_ptr) cinfo->marker)->process_COM) (cinfo)) |
- return JPEG_SUSPENDED; |
+ return JPEG_SUSPENDED; |
break; |
- case M_RST0: /* these are all parameterless */ |
+ case M_RST0: /* these are all parameterless */ |
case M_RST1: |
case M_RST2: |
case M_RST3: |
@@ -1231,12 +1094,12 @@ read_markers (j_decompress_ptr cinfo) |
TRACEMS1(cinfo, 1, JTRC_PARMLESS_MARKER, cinfo->unread_marker); |
break; |
- case M_DNL: /* Ignore DNL ... perhaps the wrong thing */ |
+ case M_DNL: /* Ignore DNL ... perhaps the wrong thing */ |
if (! skip_variable(cinfo)) |
- return JPEG_SUSPENDED; |
+ return JPEG_SUSPENDED; |
break; |
- default: /* must be DHP, EXP, JPGn, or RESn */ |
+ default: /* must be DHP, EXP, JPGn, or RESn */ |
/* For now, we treat the reserved markers as fatal errors since they are |
* likely to be used to signal incompatible JPEG Part 3 extensions. |
* Once the JPEG 3 version-number marker is well defined, this code |
@@ -1282,7 +1145,7 @@ read_restart_marker (j_decompress_ptr cinfo) |
/* Uh-oh, the restart markers have been messed up. */ |
/* Let the data source manager determine how to resync. */ |
if (! (*cinfo->src->resync_to_restart) (cinfo, |
- cinfo->marker->next_restart_num)) |
+ cinfo->marker->next_restart_num)) |
return FALSE; |
} |
@@ -1347,25 +1210,25 @@ jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired) |
{ |
int marker = cinfo->unread_marker; |
int action = 1; |
- |
+ |
/* Always put up a warning. */ |
WARNMS2(cinfo, JWRN_MUST_RESYNC, marker, desired); |
- |
+ |
/* Outer loop handles repeated decision after scanning forward. */ |
for (;;) { |
if (marker < (int) M_SOF0) |
- action = 2; /* invalid marker */ |
+ action = 2; /* invalid marker */ |
else if (marker < (int) M_RST0 || marker > (int) M_RST7) |
- action = 3; /* valid non-restart marker */ |
+ action = 3; /* valid non-restart marker */ |
else { |
if (marker == ((int) M_RST0 + ((desired+1) & 7)) || |
- marker == ((int) M_RST0 + ((desired+2) & 7))) |
- action = 3; /* one of the next two expected restarts */ |
+ marker == ((int) M_RST0 + ((desired+2) & 7))) |
+ action = 3; /* one of the next two expected restarts */ |
else if (marker == ((int) M_RST0 + ((desired-1) & 7)) || |
- marker == ((int) M_RST0 + ((desired-2) & 7))) |
- action = 2; /* a prior restart, so advance */ |
+ marker == ((int) M_RST0 + ((desired-2) & 7))) |
+ action = 2; /* a prior restart, so advance */ |
else |
- action = 1; /* desired restart or too far away */ |
+ action = 1; /* desired restart or too far away */ |
} |
TRACEMS2(cinfo, 4, JTRC_RECOVERY_ACTION, marker, action); |
switch (action) { |
@@ -1376,7 +1239,7 @@ jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired) |
case 2: |
/* Scan to the next marker, and repeat the decision loop. */ |
if (! next_marker(cinfo)) |
- return FALSE; |
+ return FALSE; |
marker = cinfo->unread_marker; |
break; |
case 3: |
@@ -1397,10 +1260,10 @@ reset_marker_reader (j_decompress_ptr cinfo) |
{ |
my_marker_ptr marker = (my_marker_ptr) cinfo->marker; |
- cinfo->comp_info = NULL; /* until allocated by get_sof */ |
- cinfo->input_scan_number = 0; /* no SOS seen yet */ |
- cinfo->unread_marker = 0; /* no pending marker */ |
- marker->pub.saw_SOI = FALSE; /* set internal state too */ |
+ cinfo->comp_info = NULL; /* until allocated by get_sof */ |
+ cinfo->input_scan_number = 0; /* no SOS seen yet */ |
+ cinfo->unread_marker = 0; /* no pending marker */ |
+ marker->pub.saw_SOI = FALSE; /* set internal state too */ |
marker->pub.saw_SOF = FALSE; |
marker->pub.discarded_bytes = 0; |
marker->cur_marker = NULL; |
@@ -1421,7 +1284,7 @@ jinit_marker_reader (j_decompress_ptr cinfo) |
/* Create subobject in permanent pool */ |
marker = (my_marker_ptr) |
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, |
- SIZEOF(my_marker_reader)); |
+ sizeof(my_marker_reader)); |
cinfo->marker = (struct jpeg_marker_reader *) marker; |
/* Initialize public method pointers */ |
marker->pub.reset_marker_reader = reset_marker_reader; |
@@ -1452,7 +1315,7 @@ jinit_marker_reader (j_decompress_ptr cinfo) |
GLOBAL(void) |
jpeg_save_markers (j_decompress_ptr cinfo, int marker_code, |
- unsigned int length_limit) |
+ unsigned int length_limit) |
{ |
my_marker_ptr marker = (my_marker_ptr) cinfo->marker; |
long maxlength; |
@@ -1461,7 +1324,7 @@ jpeg_save_markers (j_decompress_ptr cinfo, int marker_code, |
/* Length limit mustn't be larger than what we can allocate |
* (should only be a concern in a 16-bit environment). |
*/ |
- maxlength = cinfo->mem->max_alloc_chunk - SIZEOF(struct jpeg_marker_struct); |
+ maxlength = cinfo->mem->max_alloc_chunk - sizeof(struct jpeg_marker_struct); |
if (((long) length_limit) > maxlength) |
length_limit = (unsigned int) maxlength; |
@@ -1501,7 +1364,7 @@ jpeg_save_markers (j_decompress_ptr cinfo, int marker_code, |
GLOBAL(void) |
jpeg_set_marker_processor (j_decompress_ptr cinfo, int marker_code, |
- jpeg_marker_parser_method routine) |
+ jpeg_marker_parser_method routine) |
{ |
my_marker_ptr marker = (my_marker_ptr) cinfo->marker; |