Module: libav
Branch: master
Commit: c9837954e7b968d44f82e7cdb7618e9f523b196c

Author:    Michael Niedermayer <[email protected]>
Committer: Ronald S. Bultje <[email protected]>
Date:      Sat Mar 10 00:08:32 2012 +0100

snow: reject unsupported chroma shifts.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: [email protected]
Signed-off-by: Ronald S. Bultje <[email protected]>

---

 libavcodec/snowdec.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c
index 1dccc63..58a80b3 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);

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to