STRIDE_ALIGN is not known in libavutil so av_image_check_size* cannot consider 
it

Fixes: OOM
Fixes: 
8291/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-5176528009691136

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
---
 libavcodec/decode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 421a8f1a35..6a3a4df179 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1837,7 +1837,7 @@ static int get_buffer_internal(AVCodecContext *avctx, 
AVFrame *frame, int flags)
     int ret;
 
     if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
-        if ((ret = av_image_check_size2(avctx->width, avctx->height, 
avctx->max_pixels, AV_PIX_FMT_NONE, 0, avctx)) < 0 || avctx->pix_fmt<0) {
+        if ((ret = av_image_check_size2(FFALIGN(avctx->width, STRIDE_ALIGN), 
avctx->height, avctx->max_pixels, AV_PIX_FMT_NONE, 0, avctx)) < 0 || 
avctx->pix_fmt<0) {
             av_log(avctx, AV_LOG_ERROR, "video_get_buffer: image parameters 
invalid\n");
             return AVERROR(EINVAL);
         }
-- 
2.17.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to