Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Unified Diff: core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/tcd.c

Issue 671943002: update openjpeg to r2911 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/j2k.c ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/tcd.c
diff --git a/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/tcd.c b/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/tcd.c
index 7dd93e99168600adec87d2efc26796414f0cfbe1..1720b8efa54edd04041616213c549514c5cbaaf2 100644
--- a/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/tcd.c
+++ b/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/tcd.c
@@ -676,7 +676,7 @@ OPJ_BOOL FUNCTION ( opj_tcd_t *p_tcd, \
/*tile->numcomps = image->numcomps; */ \
for(compno = 0; compno < l_tile->numcomps; ++compno) { \
/*fprintf(stderr, "compno = %d/%d\n", compno, l_tile->numcomps);*/ \
- \
+ l_image_comp->resno_decoded = 0; \
/* border of each l_tile component (global) */ \
l_tilec->x0 = opj_int_ceildiv(l_tile->x0, (OPJ_INT32)l_image_comp->dx); \
l_tilec->y0 = opj_int_ceildiv(l_tile->y0, (OPJ_INT32)l_image_comp->dy); \
@@ -970,15 +970,14 @@ OPJ_BOOL FUNCTION ( opj_tcd_t *p_tcd, \
OPJ_INT32 cblkxend = cblkxstart + (1 << cblkwidthexpn); \
OPJ_INT32 cblkyend = cblkystart + (1 << cblkheightexpn); \
\
+ if (! FUNCTION_ELEMENT(l_code_block)) { \
+ return OPJ_FALSE; \
+ } \
/* code-block size (global) */ \
l_code_block->x0 = opj_int_max(cblkxstart, l_current_precinct->x0); \
l_code_block->y0 = opj_int_max(cblkystart, l_current_precinct->y0); \
l_code_block->x1 = opj_int_min(cblkxend, l_current_precinct->x1); \
l_code_block->y1 = opj_int_min(cblkyend, l_current_precinct->y1); \
- \
- if (! FUNCTION_ELEMENT(l_code_block)) { \
- return OPJ_FALSE; \
- } \
++l_code_block; \
} \
++l_current_precinct; \
@@ -1054,9 +1053,19 @@ OPJ_BOOL opj_tcd_code_block_dec_allocate (opj_tcd_cblk_dec_t * p_code_block)
p_code_block->m_current_max_segs = OPJ_J2K_DEFAULT_NB_SEGS;
/*fprintf(stderr, "m_current_max_segs of code_block->data = %d\n", p_code_block->m_current_max_segs);*/
- }
- /* TODO */
- /*p_code_block->numsegs = 0; */
+ } else {
+ /* sanitize */
+ OPJ_BYTE* l_data = p_code_block->data;
+ OPJ_UINT32 l_data_max_size = p_code_block->data_max_size;
+ opj_tcd_seg_t * l_segs = p_code_block->segs;
+ OPJ_UINT32 l_current_max_segs = p_code_block->m_current_max_segs;
+
+ memset(p_code_block, 0, sizeof(opj_tcd_cblk_dec_t));
Tom Sepez 2014/10/22 19:03:06 How do we know that p_code_block can accomodate si
Bo Xu 2014/10/22 22:29:03 I am asking openjpeg team to cc you in their bug t
+ p_code_block->data = l_data;
+ p_code_block->data_max_size = l_data_max_size;
+ p_code_block->segs = l_segs;
+ p_code_block->m_current_max_segs = l_current_max_segs;
+ }
return OPJ_TRUE;
}
« no previous file with comments | « core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/j2k.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698