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

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

Issue 589243004: Update openjpeg (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Merge security fixes from openjpeg r2883 Created 6 years, 3 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
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 c1086755d639af4927eb28e6a92ba962a49ed6db..41c6d5bf1ff205483701733ad01137f010ff44dc 100644
--- a/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/tcd.c
+++ b/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/tcd.c
@@ -467,6 +467,10 @@ OPJ_BOOL opj_tcd_rateallocate( opj_tcd_t *tcd,
tile_info->numpix = tcd_tile->numpix;
tile_info->distotile = tcd_tile->distotile;
tile_info->thresh = (OPJ_FLOAT64 *) opj_malloc(tcd_tcp->numlayers * sizeof(OPJ_FLOAT64));
+ if (!tile_info->thresh) {
+ /* FIXME event manager error callback */
+ return OPJ_FALSE;
+ }
}
for (layno = 0; layno < tcd_tcp->numlayers; layno++) {
@@ -1137,6 +1141,10 @@ OPJ_BOOL opj_tcd_encode_tile( opj_tcd_t *p_tcd,
p_cstr_info->tile[p_tile_no].pdy[i] = (int)l_tccp->prch[i];
}
p_cstr_info->tile[p_tile_no].packet = (opj_packet_info_t*) opj_calloc((size_t)p_cstr_info->numcomps * (size_t)p_cstr_info->numlayers * l_num_packs, sizeof(opj_packet_info_t));
+ if (!p_cstr_info->tile[p_tile_no].packet) {
+ /* FIXME event manager error callback */
+ return OPJ_FALSE;
+ }
}
/* << INDEX */

Powered by Google App Engine
This is Rietveld 408576698