1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-29 18:42:09 +00:00

demux_lavf: fix a minor memory leak

This commit is contained in:
wm4 2016-05-08 13:24:22 +02:00
parent ababfcbfe3
commit 2f8b4dd480

View File

@ -1101,8 +1101,12 @@ static void demux_close_lavf(demuxer_t *demuxer)
av_freep(&priv->pb->buffer);
av_freep(&priv->pb);
for (int n = 0; n < priv->num_streams; n++) {
if (priv->streams[n])
if (priv->streams[n]) {
avcodec_free_context(&priv->streams[n]->codec->lav_headers);
#if HAVE_AVCODEC_HAS_CODECPAR
avcodec_parameters_free(&priv->streams[n]->codec->lav_codecpar);
#endif
}
}
if (priv->stream != demuxer->stream)
free_stream(priv->stream);