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

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

Issue 589243004: Update openjpeg (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Update to openjpeg r2891 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/image.c
diff --git a/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/image.c b/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/image.c
index 2c3540c5173d435dcdcb2b5a4bc855f1a0779ff7..8e68668e42758a97d7e61d18017f26115a342835 100644
--- a/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/image.c
+++ b/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/image.c
@@ -205,21 +205,19 @@ opj_image_t* OPJ_CALLCONV opj_image_tile_create(OPJ_UINT32 numcmpts, opj_image_c
OPJ_UINT32 compno;
opj_image_t *image = 00;
- image = (opj_image_t*) opj_malloc(sizeof(opj_image_t));
+ image = (opj_image_t*) opj_calloc(1,sizeof(opj_image_t));
if (image)
{
- memset(image,0,sizeof(opj_image_t));
image->color_space = clrspc;
image->numcomps = numcmpts;
/* allocate memory for the per-component information */
- image->comps = (opj_image_comp_t*)opj_malloc(image->numcomps * sizeof(opj_image_comp_t));
+ image->comps = (opj_image_comp_t*)opj_calloc(image->numcomps, sizeof(opj_image_comp_t));
if (!image->comps) {
opj_image_destroy(image);
return 00;
}
- memset(image->comps,0,image->numcomps * sizeof(opj_image_comp_t));
/* create the individual image components */
for(compno = 0; compno < numcmpts; compno++) {
« no previous file with comments | « core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/function_list.c ('k') | core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/j2k.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698