diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-08-11 02:00:33 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-08-11 02:00:33 +0200 |
commit | f9505923a344a56c3ff36925adb7f0c3c9a3996c (patch) | |
tree | 3311cb63dccee4b80e1e1e6ab1c0df2674408c40 | |
parent | bd6ece4609b49eb40f880252452b809bff8f13ec (diff) | |
download | ffmpeg-f9505923a344a56c3ff36925adb7f0c3c9a3996c.tar.gz |
cavsdec: check dimensions being valid.
Fixes crash
Fixes Ticket1628
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/cavsdec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index 2131cd447f..099599ae51 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -625,6 +625,10 @@ static int decode_seq_header(AVSContext *h) { av_log_missing_feature(s, "Width/height changing in CAVS is", 0); return -1; } + if (width <= 0 || height <= 0) { + av_log(s, AV_LOG_ERROR, "Dimensions invalid\n"); + return AVERROR_INVALIDDATA; + } s->width = width; s->height = height; skip_bits(&s->gb,2); //chroma format |