diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-03-10 00:08:32 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-03-10 00:18:29 +0100 |
commit | 1af9fdc3baa47596757da7c401d58710cef45c75 (patch) | |
tree | eed64b4e371981a090bc9f4142c228e925512936 /libavcodec/snowdec.c | |
parent | aefd1cb7256703ecd40f737e266612bfb8116054 (diff) | |
download | ffmpeg-1af9fdc3baa47596757da7c401d58710cef45c75.tar.gz |
snow: reject unsupported chroma shifts.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/snowdec.c')
-rw-r--r-- | libavcodec/snowdec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c index 265d8e7dd0..537a6c6e8f 100644 --- a/libavcodec/snowdec.c +++ b/libavcodec/snowdec.c @@ -336,6 +336,11 @@ static int decode_header(SnowContext *s){ return -1; } + if (s->chroma_h_shift != 1 || s->chroma_v_shift != 1) { + av_log(s->avctx, AV_LOG_ERROR, "Invalid chroma shift\n"); + return AVERROR_PATCHWELCOME; + } + s->qlog += get_symbol(&s->c, s->header_state, 1); s->mv_scale += get_symbol(&s->c, s->header_state, 1); s->qbias += get_symbol(&s->c, s->header_state, 1); |