Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-08-14 20:58:49 +0400
committerMichael Niedermayer <michaelni@gmx.at>2012-09-19 03:08:24 +0400
commit501e60dcf5bb82572aa7bca44cf072b3c15d44aa (patch)
tree11216be39825a4e09b7c49b7f85fba90e67df7a3
parentd36c706b868b4801bb5e9756bf921ecc8ca8ae10 (diff)
bmv_videodec: fix out of array read
Fixes Ticket1373 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 70f0ffa1ed456fd0b560d0dd1d0d93f1ba3a6d93) Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit d721cb009d73662f35c629bdc678e25786e79301) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/bmv.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/bmv.c b/libavcodec/bmv.c
index 35923a28d6..d2f4e9f86c 100644
--- a/libavcodec/bmv.c
+++ b/libavcodec/bmv.c
@@ -268,6 +268,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
c->avctx = avctx;
avctx->pix_fmt = PIX_FMT_PAL8;
+ if (avctx->width != SCREEN_WIDE || avctx->height != SCREEN_HIGH) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid dimension %dx%d\n", avctx->width, avctx->height);
+ return AVERROR_INVALIDDATA;
+ }
+
c->pic.reference = 1;
if (avctx->get_buffer(avctx, &c->pic) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");