mirror of https://github.com/mpv-player/mpv
demux_lavf: fix a minor memory leak
This commit is contained in:
parent
ababfcbfe3
commit
2f8b4dd480
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue