diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-07-12 06:36:25 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-07-12 21:03:09 +0200 |
commit | ccd6911c189d2f974dcc4095c963dfad14d703d2 (patch) | |
tree | af9581f567817be451c6a4fd8b4618c77f6c77d5 /libavcodec/hevc.c | |
parent | 52fafaf4740b78174e9da0d2aaaf3dd93ab33d63 (diff) | |
download | ffmpeg-ccd6911c189d2f974dcc4095c963dfad14d703d2.tar.gz |
avcodec/hevc_ps: do not loose all reference to pointers still in use
Fixes leaving a pointer to unreferenced memory
Fixes Ticket 3115
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/hevc.c')
-rw-r--r-- | libavcodec/hevc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c index a64c627b02..2cdd08a7de 100644 --- a/libavcodec/hevc.c +++ b/libavcodec/hevc.c @@ -2966,6 +2966,8 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx) for (i = 0; i < FF_ARRAY_ELEMS(s->pps_list); i++) av_buffer_unref(&s->pps_list[i]); + av_buffer_unref(&s->current_sps); + av_freep(&s->sh.entry_point_offset); av_freep(&s->sh.offset); av_freep(&s->sh.size); @@ -3088,6 +3090,10 @@ static int hevc_update_thread_context(AVCodecContext *dst, } } + if (s->current_sps && s->sps == (HEVCSPS*)s->current_sps->data) + s->sps = NULL; + av_buffer_unref(&s->current_sps); + if (s->sps != s0->sps) ret = set_sps(s, s0->sps); |