summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/libjpeg/jdcoefct.c
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/libjpeg/jdcoefct.c')
-rw-r--r--3rdparty/libjpeg/jdcoefct.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/3rdparty/libjpeg/jdcoefct.c b/3rdparty/libjpeg/jdcoefct.c
index 462e92c6125..ed02fc378f5 100644
--- a/3rdparty/libjpeg/jdcoefct.c
+++ b/3rdparty/libjpeg/jdcoefct.c
@@ -2,6 +2,7 @@
* jdcoefct.c
*
* Copyright (C) 1994-1997, Thomas G. Lane.
+ * Modified 2002-2011 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -162,8 +163,9 @@ decompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
for (MCU_col_num = coef->MCU_ctr; MCU_col_num <= last_MCU_col;
MCU_col_num++) {
/* Try to fetch an MCU. Entropy decoder expects buffer to be zeroed. */
- jzero_far((void FAR *) coef->MCU_buffer[0],
- (size_t) (cinfo->blocks_in_MCU * SIZEOF(JBLOCK)));
+ if (cinfo->lim_Se) /* can bypass in DC only case */
+ FMEMZERO((void FAR *) coef->MCU_buffer[0],
+ (size_t) (cinfo->blocks_in_MCU * SIZEOF(JBLOCK)));
if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {
/* Suspension forced; update state counters and exit */
coef->MCU_vert_offset = yoffset;
@@ -729,6 +731,9 @@ jinit_d_coef_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
for (i = 0; i < D_MAX_BLOCKS_IN_MCU; i++) {
coef->MCU_buffer[i] = buffer + i;
}
+ if (cinfo->lim_Se == 0) /* DC only case: want to bypass later */
+ FMEMZERO((void FAR *) buffer,
+ (size_t) (D_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK)));
coef->pub.consume_data = dummy_consume_data;
coef->pub.decompress_data = decompress_onepass;
coef->pub.coef_arrays = NULL; /* flag for no virtual arrays */