wmaenc: fix off by 1 error in quantization loop
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 30 Jun 2012 17:38:11 +0000 (19:38 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 30 Jun 2012 17:38:11 +0000 (19:38 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/wmaenc.c

index 93522af..360902a 100644 (file)
@@ -379,7 +379,7 @@ static int encode_superframe(AVCodecContext *avctx, AVPacket *avpkt,
     for(i=64; i; i>>=1){
         int error = encode_frame(s, s->coefs, avpkt->data, avpkt->size,
                                  total_gain - i);
-        if(error<0)
+        if(error<=0)
             total_gain-= i;
     }
 #else