mirror of
https://github.com/zebrajr/opencv.git
synced 2025-12-06 00:19:46 +01:00
Fix Heap-buffer-overflow READ in opj_jp2_apply_pclr
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47342 The read overflow triggered by reading `src[j]` in ```cpp for (j = 0; j < max; ++j) { dst[j] = src[j]; } ``` The max is calculated as `new_comps[pcol].w * new_comps[pcol].h`, however the `src = old_comps[cmp].data;` which may have different `w` and `h` dimensions.
This commit is contained in:
parent
9208dcb07c
commit
a2fc479c0b
2
3rdparty/openjpeg/openjp2/jp2.c
vendored
2
3rdparty/openjpeg/openjp2/jp2.c
vendored
|
|
@ -1108,7 +1108,7 @@ static OPJ_BOOL opj_jp2_apply_pclr(opj_image_t *image,
|
|||
pcol = cmap[i].pcol;
|
||||
src = old_comps[cmp].data;
|
||||
assert(src); /* verified above */
|
||||
max = new_comps[pcol].w * new_comps[pcol].h;
|
||||
max = new_comps[i].w * new_comps[i].h;
|
||||
|
||||
/* Direct use: */
|
||||
if (cmap[i].mtyp == 0) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user