diff options
| author | Even Rouault <even.rouault@mines-paris.org> | 2018-02-25 18:21:23 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-02-25 18:21:23 +0100 |
| commit | 90b1bffa7e745c754afb56dc89ccb70f8aeeadcf (patch) | |
| tree | 3540b676f0c6a8b81ac9e6f0f85d48eef9e05f7e /src/lib | |
| parent | 06f7d412435ddb62f8e9935af7e306783bc4b75b (diff) | |
| parent | 24d08ff94ad8b0f51534e46f87cf5a2f2f85d22a (diff) | |
Merge pull request #1080 from setharnold/patch-1
fix unchecked integer multiplication overflow
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/openjp2/image.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/openjp2/image.c b/src/lib/openjp2/image.c index 13bcb8e4..fe373905 100644 --- a/src/lib/openjp2/image.c +++ b/src/lib/openjp2/image.c @@ -48,8 +48,8 @@ opj_image_t* OPJ_CALLCONV opj_image_create(OPJ_UINT32 numcmpts, image->color_space = clrspc; image->numcomps = numcmpts; /* allocate memory for the per-component information */ - image->comps = (opj_image_comp_t*)opj_calloc(1, - 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) { /* TODO replace with event manager, breaks API */ /* fprintf(stderr,"Unable to allocate memory for image.\n"); */ |
