1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/h264: Free rbsp_buffer before copying context over it

Fixes memleak
Fixes Ticket1900

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-08-25 03:15:26 +02:00
parent be30e44dd9
commit 626739ebbb

View File

@ -1767,6 +1767,8 @@ static int decode_update_thread_context(AVCodecContext *dst,
for (i = 0; i < MAX_PPS_COUNT; i++)
av_freep(h->pps_buffers + i);
av_freep(&h->rbsp_buffer[0]);
av_freep(&h->rbsp_buffer[1]);
memcpy(h, h1, offsetof(H264Context, intra_pcm_ptr));
memcpy(&h->cabac, &h1->cabac,
sizeof(H264Context) - offsetof(H264Context, cabac));