diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-09-04 22:23:26 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-09-30 23:35:45 +0200 |
commit | 64e034da954125ef98fb8f9153f9706cdb8a96fe (patch) | |
tree | 27316d9fcdc80872aefaff1842cb1a9d3e253cd6 | |
parent | e9f9175db60ac67e906f8ad0709129843ab41d14 (diff) | |
download | ffmpeg-64e034da954125ef98fb8f9153f9706cdb8a96fe.tar.gz |
avcodec/jpeg2000: Check that codsty->log2_prec_widths/heights has been initialized
Fixes: OOM
Fixes: 2225/clusterfuzz-testcase-minimized-5505632079708160
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/jpeg2000.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/jpeg2000.c b/libavcodec/jpeg2000.c index 94efc94c4d..afeb9df27c 100644 --- a/libavcodec/jpeg2000.c +++ b/libavcodec/jpeg2000.c @@ -506,6 +506,9 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp, // update precincts size: 2^n value reslevel->log2_prec_width = codsty->log2_prec_widths[reslevelno]; reslevel->log2_prec_height = codsty->log2_prec_heights[reslevelno]; + if (!reslevel->log2_prec_width || !reslevel->log2_prec_height) { + return AVERROR_INVALIDDATA; + } /* Number of bands for each resolution level */ if (reslevelno == 0) |