avcodec/mpegvideo_enc: Fix leak on bitstream buffer reallocation
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 30 Sep 2014 03:11:19 +0000 (05:11 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 30 Sep 2014 03:19:20 +0000 (05:19 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/mpegvideo_enc.c

index 045ef3d..d045179 100644 (file)
@@ -2795,6 +2795,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
                 av_fast_padded_malloc(&new_buffer, &new_buffer_size, new_size);
                 if (new_buffer) {
                     memcpy(new_buffer, s->avctx->internal->byte_buffer, s->avctx->internal->byte_buffer_size);
+                    av_free(s->avctx->internal->byte_buffer);
                     s->avctx->internal->byte_buffer      = new_buffer;
                     s->avctx->internal->byte_buffer_size = new_buffer_size;
                     rebase_put_bits(&s->pb, new_buffer, new_buffer_size);