Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-04-16 01:54:09 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2019-04-25 15:49:51 +0300
commit6381b6f6a9736f9bae92618c3d43c50b21810146 (patch)
treea7f5a4daaa7b6639acd74836228f3d9ffc0bfbcc /libavcodec/jpeg2000dec.c
parent06ef186fa1b7329c6fe6723372a72464c998059b (diff)
avcodec/jpeg2000dec: Replace the step_x/y assert by a check in the CPRL case as with the PCRL case
Fixes: assertion failure Fixes: 14246/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5758393601490944 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/jpeg2000dec.c')
-rw-r--r--libavcodec/jpeg2000dec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 7749c980e5..9198cf87cb 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -1171,7 +1171,10 @@ static int jpeg2000_decode_packets_po_iteration(Jpeg2000DecoderContext *s, Jpeg2
step_x = FFMIN(step_x, rlevel->log2_prec_width + reducedresno);
step_y = FFMIN(step_y, rlevel->log2_prec_height + reducedresno);
}
- av_assert0(step_x < 32 && step_y < 32);
+ if (step_x >= 31 || step_y >= 31){
+ avpriv_request_sample(s->avctx, "CPRL with large step");
+ return AVERROR_PATCHWELCOME;
+ }
step_x = 1<<step_x;
step_y = 1<<step_y;