aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-03-10 00:08:32 +0100
committerReinhard Tartler <siretart@tauware.de>2012-03-14 21:34:55 +0100
commitc9e95636a893225e2a5a42ba6e1e3cf6bfd59f2b (patch)
tree5252bed86a2886a4c23fe94d837f2c2d1bf3ef8c
parent6e5c07f4c81317d728bfcba5f46b4ef46de9857f (diff)
downloadffmpeg-c9e95636a893225e2a5a42ba6e1e3cf6bfd59f2b.tar.gz
snow: reject unsupported chroma shifts.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com> (cherry picked from commit c9837954e7b968d44f82e7cdb7618e9f523b196c) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r--libavcodec/snowdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c
index 2b6f6e11c7..d9f61bc7ca 100644
--- a/libavcodec/snowdec.c
+++ b/libavcodec/snowdec.c
@@ -327,6 +327,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);