Commit 61c06830 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/mpegvideo_enc: Fix leak on bitstream buffer reallocation

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 1441641d
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment