diff options
author | Sebastian Vater <cdgs.basty@googlemail.com> | 2010-05-10 17:00:56 +0000 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2010-05-10 17:00:56 +0000 |
commit | 59cca5040e8da935833fb78510cfb1db124a9528 (patch) | |
tree | a0afe0772ef76b07c8705409ddf461ff45920523 /libavcodec/iff.c | |
parent | 666d7d18e1650d0467ad86d5e9bbc0dbef81c8fa (diff) | |
download | ffmpeg-59cca5040e8da935833fb78510cfb1db124a9528.tar.gz |
Ensure that width and height are > 0. avcodec_open() itself only checks that
they are >= 0.
Patch by Sebastian Vater <cdgs basty googlemail com>.
Originally committed as revision 23080 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/iff.c')
-rw-r--r-- | libavcodec/iff.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/iff.c b/libavcodec/iff.c index c911811da4..901c8f4e6c 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -115,6 +115,8 @@ static av_cold int decode_init(AVCodecContext *avctx) return AVERROR_INVALIDDATA; } + if ((err = avcodec_check_dimensions(avctx, avctx->width, avctx->height))) + return err; s->planesize = FFALIGN(avctx->width, 16) >> 3; // Align plane size in bits to word-boundary s->planebuf = av_malloc(s->planesize + FF_INPUT_BUFFER_PADDING_SIZE); if (!s->planebuf) |