summaryrefslogtreecommitdiff
path: root/libavcodec/vcr1.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-17 20:17:22 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-17 20:43:56 +0100
commit845724c82c1a732ab398c9e8cedd178f96f1626d (patch)
treebd91e63e71e8d73d4c26df75791ff8c11e2ef8b0 /libavcodec/vcr1.c
parentfb1ea777b3a01be6d71a103529ad37982707cacc (diff)
vcr1: check if dimensions are supported, fix out of array accesses.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vcr1.c')
-rw-r--r--libavcodec/vcr1.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/vcr1.c b/libavcodec/vcr1.c
index 2a4a090885..acac925870 100644
--- a/libavcodec/vcr1.c
+++ b/libavcodec/vcr1.c
@@ -50,6 +50,10 @@ static av_cold int vcr1_decode_init(AVCodecContext *avctx)
avctx->pix_fmt = AV_PIX_FMT_YUV410P;
+ if (avctx->width % 8 || avctx->height%4) {
+ av_log_ask_for_sample(avctx, "odd dimensions are not supported\n");
+ return AVERROR_PATCHWELCOME;
+ }
return 0;
}