summaryrefslogtreecommitdiffstats
path: root/libavcodec/decode.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-06-14 15:00:55 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-06-15 21:51:42 +0200
commit2e205bfc14d8cecf88f8713275fe8e07454d00b5 (patch)
treeda1d171b68dc59b59cc329e914d221f95d67891f /libavcodec/decode.c
parent3dc5aa36fbbd025d60baa948e1778fa2827615bf (diff)
downloadffmpeg-streaming-2e205bfc14d8cecf88f8713275fe8e07454d00b5.zip
ffmpeg-streaming-2e205bfc14d8cecf88f8713275fe8e07454d00b5.tar.gz
avcodec/decode: Consider STRIDE_ALIGN in get_buffer_internal() when checking width
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 <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/decode.c')
-rw-r--r--libavcodec/decode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 421a8f1..6a3a4df1 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);
}
OpenPOWER on IntegriCloud