Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-07-13 23:26:53 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-13 23:26:53 +0300
commit85b7456efe9c6e6047c849626190f138faa8b42d (patch)
treed11941d433b1fc97de29596ce63fc5533265d302 /libavcodec/hevc_parser.c
parent32d023eb6d0a80be551d8cfb207df61928db930b (diff)
avcodec/hevc_parser: Fix memleaks in parser mix
Found-by: jamrial Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/hevc_parser.c')
-rw-r--r--libavcodec/hevc_parser.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libavcodec/hevc_parser.c b/libavcodec/hevc_parser.c
index fd879a6436..8b232440b9 100644
--- a/libavcodec/hevc_parser.c
+++ b/libavcodec/hevc_parser.c
@@ -183,7 +183,7 @@ static inline int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
GetBitContext *gb;
SliceHeader *sh = &h->sh;
HEVCParamSets *ps = &h->ps;
- HEVCPacket *pkt = &h->pkt;
+ HEVCPacket *pkt = &ctx->pkt;
const uint8_t *buf_end = buf + buf_size;
int state = -1, i;
HEVCNAL *nal;
@@ -420,6 +420,16 @@ static void hevc_parser_close(AVCodecParserContext *s)
#if ADVANCED_PARSER
HEVCContext *h = &ctx->h;
+
+ for (i = 0; i < FF_ARRAY_ELEMS(h->ps.vps_list); i++)
+ av_buffer_unref(&h->ps.vps_list[i]);
+ for (i = 0; i < FF_ARRAY_ELEMS(h->ps.sps_list); i++)
+ av_buffer_unref(&h->ps.sps_list[i]);
+ for (i = 0; i < FF_ARRAY_ELEMS(h->ps.pps_list); i++)
+ av_buffer_unref(&h->ps.pps_list[i]);
+
+ h->ps.sps = NULL;
+
av_freep(&h->HEVClc);
#endif