aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShitiz Garg <mail-5deEcKV3Bynk1uMJSBkQmQ@public.gmane.org>2011-12-16 04:50:21 +0530
committerMichael Niedermayer <michaelni@gmx.at>2012-01-03 19:03:05 +0100
commit34cee5bd373ec6cc297753957b73e47f31566a1d (patch)
tree3dbbbb135350f27b43cdcf93cc907509597532dc
parent95234da75eac6e77d5747abecd3f2edf45c3a37c (diff)
downloadffmpeg-34cee5bd373ec6cc297753957b73e47f31566a1d.tar.gz
cljr: Check if width or height are positive integers
width and height might get passed as 0 and would cause floating point exceptions in decode_frame. Fixes bugzilla #149 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 4af0262f7d531c33b00d7f9dbca808d9c62d6a84) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/cljr.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/cljr.c b/libavcodec/cljr.c
index d36e0a0a12..4027cff4c7 100644
--- a/libavcodec/cljr.c
+++ b/libavcodec/cljr.c
@@ -61,6 +61,11 @@ static int decode_frame(AVCodecContext *avctx,
if (p->data[0])
avctx->release_buffer(avctx, p);
+ if (avctx->height <= 0 || avctx->width <= 0) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid width or height\n");
+ return AVERROR_INVALIDDATA;
+ }
+
if (buf_size / avctx->height < avctx->width) {
av_log(avctx, AV_LOG_ERROR,
"Resolution larger than buffer size. Invalid header?\n");