summaryrefslogtreecommitdiff
path: root/libavcodec/escape130.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-08 13:38:13 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-12-08 18:31:21 +0100
commit59d3656f6ed8ef9f0d95673de0cc1e44614cb765 (patch)
tree96153f685ed3164d8a1e8f0f1f427765b7cf1f2f /libavcodec/escape130.c
parent8ac6469575b8e02c634c48f9197c1fd550fa25b2 (diff)
escape130: Check dimensions to be a multiple of the block size.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/escape130.c')
-rw-r--r--libavcodec/escape130.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/escape130.c b/libavcodec/escape130.c
index 1198010881..e7ba7bd508 100644
--- a/libavcodec/escape130.c
+++ b/libavcodec/escape130.c
@@ -43,6 +43,11 @@ static av_cold int escape130_decode_init(AVCodecContext *avctx)
Escape130Context *s = avctx->priv_data;
avctx->pix_fmt = PIX_FMT_YUV420P;
+ if((avctx->width&1) || (avctx->height&1)){
+ av_log(avctx, AV_LOG_ERROR, "Dimensions are not a multiple of the block size\n");
+ return AVERROR(EINVAL);
+ }
+
s->bases= av_malloc(avctx->width * avctx->height /4);
return 0;