sonicenc: limit quant so that golomb codes are less than 32 bits long
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 18 Sep 2012 15:33:55 +0000 (17:33 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 18 Sep 2012 15:33:55 +0000 (17:33 +0200)
before they could become 33 bits

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/sonic.c

index acd7412..d412d60 100644 (file)
@@ -724,8 +724,8 @@ static int sonic_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
 
         if (quant < 1)
             quant = 1;
-        if (quant > 65535)
-            quant = 65535;
+        if (quant > 65534)
+            quant = 65534;
 
         set_ue_golomb(&pb, quant);