[FFmpeg-cvslog] avcodec/jpeg2000dec: Use av_image_check_size2()

Michael Niedermayer git at videolan.org
Sun Feb 18 14:11:30 EET 2018


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Feb 17 04:20:53 2018 +0100| [01370b31aced784593f2bc0836f4ba6fd8e7f6b3] | committer: Michael Niedermayer

avcodec/jpeg2000dec: Use av_image_check_size2()

Fixes: OOM
Fixes: 5733/clusterfuzz-testcase-minimized-4906757966004224

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=01370b31aced784593f2bc0836f4ba6fd8e7f6b3
---

 libavcodec/jpeg2000dec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 4cf8a2880c..5414ce5655 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -285,7 +285,7 @@ static int get_siz(Jpeg2000DecoderContext *s)
         avpriv_request_sample(s->avctx, "Support for image offsets");
         return AVERROR_PATCHWELCOME;
     }
-    if (av_image_check_size(s->width, s->height, 0, s->avctx)) {
+    if (av_image_check_size2(s->width, s->height, s->avctx->max_pixels, AV_PIX_FMT_NONE, 0, s->avctx)) {
         avpriv_request_sample(s->avctx, "Large Dimensions");
         return AVERROR_PATCHWELCOME;
     }



More information about the ffmpeg-cvslog mailing list