From 799df083f3196d96ead6ea4400426dbd178573b1 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 30 Jun 2012 19:38:11 +0200 Subject: [PATCH] wmaenc: fix off by 1 error in quantization loop Signed-off-by: Michael Niedermayer --- libavcodec/wmaenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c index 93522af91f..360902a5c8 100644 --- a/libavcodec/wmaenc.c +++ b/libavcodec/wmaenc.c @@ -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