diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-29 15:18:17 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-12-03 20:45:45 +0100 |
commit | 38e8f78c041bd28f5b8d32f2fd945eae8ce28598 (patch) | |
tree | 14498ff3c97237b6f004f66d2686842f2f9186cc | |
parent | c82d6e05da0898c45ae915fb808e175f6a4ec7e5 (diff) | |
download | ffmpeg-38e8f78c041bd28f5b8d32f2fd945eae8ce28598.tar.gz |
roqvideodec: check dimensions validity
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3ae610451170cd5a28b33950006ff0bd23036845)
-rw-r--r-- | libavcodec/roqvideodec.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/roqvideodec.c b/libavcodec/roqvideodec.c index b4cf454e9a..229022be8b 100644 --- a/libavcodec/roqvideodec.c +++ b/libavcodec/roqvideodec.c @@ -169,6 +169,12 @@ static av_cold int roq_decode_init(AVCodecContext *avctx) RoqContext *s = avctx->priv_data; s->avctx = avctx; + + if (avctx->width%16 || avctx->height%16) { + av_log_ask_for_sample(avctx, "dimensions not being a multiple of 16 are unsupported\n"); + return AVERROR_PATCHWELCOME; + } + s->width = avctx->width; s->height = avctx->height; avcodec_get_frame_defaults(&s->frames[0]); |