libmp3lame: use the correct remaining buffer size when flushing
authorJustin Ruggles <justin.ruggles@gmail.com>
Wed, 16 Jan 2013 22:52:55 +0000 (17:52 -0500)
committerReinhard Tartler <siretart@tauware.de>
Sat, 9 Mar 2013 17:10:16 +0000 (18:10 +0100)
CC:libav-stable@libav.org
(cherry picked from commit e984f47873258b600fd88423f40e3cdaad179190)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
libavcodec/libmp3lame.c

index 264a0e2..8746573 100644 (file)
@@ -217,7 +217,7 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
         }
     } else {
         lame_result = lame_encode_flush(s->gfp, s->buffer + s->buffer_index,
-                                        BUFFER_SIZE - s->buffer_index);
+                                        s->buffer_size - s->buffer_index);
     }
     if (lame_result < 0) {
         if (lame_result == -1) {