diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-03-24 02:40:24 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-03-24 03:26:52 +0100 |
commit | 25715064c2ef4978672a91f8c856f3e8809a7c45 (patch) | |
tree | a4852c6aec2d717c8f146289a5f0b392bead58b7 /libavcodec/cavsdec.c | |
parent | ba775a54bc2136ec5da85385a923b05ee6fab159 (diff) | |
download | ffmpeg-25715064c2ef4978672a91f8c856f3e8809a7c45.tar.gz |
cavsdec: check for changing w/h.
Our decoder does not support changing w/h.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/cavsdec.c')
-rw-r--r-- | libavcodec/cavsdec.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index 6e5539c2d7..daebda26fd 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -609,12 +609,19 @@ static int decode_pic(AVSContext *h) { static int decode_seq_header(AVSContext *h) { MpegEncContext *s = &h->s; int frame_rate_code; + int width, height; h->profile = get_bits(&s->gb,8); h->level = get_bits(&s->gb,8); skip_bits1(&s->gb); //progressive sequence - s->width = get_bits(&s->gb,14); - s->height = get_bits(&s->gb,14); + width = get_bits(&s->gb,14); + height = get_bits(&s->gb,14); + if ((s->width || s->height) && (s->width != width || s->height != height)) { + av_log_missing_feature(s, "Width/height changing in CAVS is", 0); + return -1; + } + s->width = width; + s->height = height; skip_bits(&s->gb,2); //chroma format skip_bits(&s->gb,3); //sample_precision h->aspect_ratio = get_bits(&s->gb,4); |