diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-03-23 10:48:18 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-03-23 10:48:18 +0100 |
commit | a22e64fd02133867406604cb6589bb31696f08bc (patch) | |
tree | 8b1e7404e10a3cf8f2e86350a7b73e571175b62a /libavcodec/rawdec.c | |
parent | 5934d57ba99b3dab4dfe98472ac6b30b9cf6329a (diff) | |
download | ffmpeg-a22e64fd02133867406604cb6589bb31696f08bc.tar.gz |
rawdec: Check w/h.
Fixes FPE
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/rawdec.c')
-rw-r--r-- | libavcodec/rawdec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c index 8b8e9d6a1f..b59224302a 100644 --- a/libavcodec/rawdec.c +++ b/libavcodec/rawdec.c @@ -158,6 +158,11 @@ static int raw_decode(AVCodecContext *avctx, if(buf_size < context->length - (avctx->pix_fmt==PIX_FMT_PAL8 ? 256*4 : 0)) return -1; + if (avctx->width <= 0 || avctx->height <= 0) { + av_log(avctx, AV_LOG_ERROR, "w/h is invalid\n"); + return AVERROR(EINVAL); + } + //2bpp and 4bpp raw in avi and mov (yes this is ugly ...) if (context->buffer) { int i; |