]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/jpeg2000dec: Replace the step_x/y assert by a check in the CPRL case as with...
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 15 Apr 2019 22:54:09 +0000 (00:54 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 25 Apr 2019 12:49:51 +0000 (14:49 +0200)
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>
libavcodec/jpeg2000dec.c

index 7749c980e5c56d684a84dc07db2b2715379263cd..9198cf87cb422402e64fc2551ed35ca5c6d88e0c 100644 (file)
@@ -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;