diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-11-18 01:33:18 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-11-22 13:06:50 +0100 |
commit | 3d5822d9cf07d08bce82903e4715658f46b01b5c (patch) | |
tree | a660d16797efc73b3a7cd35e41b09fa15c38a5e8 /libavcodec/jpeg2000.h | |
parent | e8e9306b4f0017c3d2ae2a9f02136279c1a105e9 (diff) | |
download | ffmpeg-3d5822d9cf07d08bce82903e4715658f46b01b5c.tar.gz |
avcodec/jpeg2000: Dynamically allocate codeblock data
Fixes: OOM
Fixes: 3541/clusterfuzz-testcase-minimized-6469958596820992
Adds support for decoding codeblock data larger than 8kb
Reduces decoder memory consumption
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/jpeg2000.h')
-rw-r--r-- | libavcodec/jpeg2000.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/jpeg2000.h b/libavcodec/jpeg2000.h index 8a022ad918..eaf7faf342 100644 --- a/libavcodec/jpeg2000.h +++ b/libavcodec/jpeg2000.h @@ -168,8 +168,8 @@ typedef struct Jpeg2000Cblk { uint16_t lengthinc[JPEG2000_MAX_PASSES]; uint8_t nb_lengthinc; uint8_t lblock; - uint8_t zero; - uint8_t data[8192]; + uint8_t *data; + size_t data_allocated; int nb_terminations; int nb_terminationsinc; int data_start[JPEG2000_MAX_PASSES]; |