svq3: protect against negative quantizers.

Message ID 20120308212851.F2DF85DE9C@aruru.libav.org
State New
Headers show

Commit Message

Janne Grunau March 8, 2012, 9:28 p.m.
Module: libav
Branch: release/0.8
Commit: 7b676935ee885d66d106436ec1acabdb8e335eca

Author:    Ronald S. Bultje <rsbultje@gmail.com>
Committer: Reinhard Tartler <siretart@tauware.de>
Date:      Mon Mar  5 17:03:32 2012 -0800

svq3: protect against negative quantizers.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 11b940a1a8e7e5d5b212935a3ce78aeda577f5f2)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>

---

 libavcodec/svq3.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index eeb8ed7..49ca456 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -651,7 +651,7 @@  static int svq3_decode_mb(SVQ3Context *svq3, unsigned int mb_type)
     if (IS_INTRA16x16(mb_type) || (s->pict_type != AV_PICTURE_TYPE_I && s->adaptive_quant && cbp)) {
         s->qscale += svq3_get_se_golomb(&s->gb);
 
-        if (s->qscale > 31){
+        if (s->qscale > 31u){
             av_log(h->s.avctx, AV_LOG_ERROR, "qscale:%d\n", s->qscale);
             return -1;
         }