mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
fftools/ffprobe: Remove redundant check before avcodec_free_context()
Besides being unnecessary it is also safer: If the error for an unrecognized option were triggered (which seems to be impossible right now), it might be that the stream whose codecpar is accessed is NULL. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
3a5412b39e
commit
d29541c90a
@ -3078,8 +3078,7 @@ static void close_input_file(InputFile *ifile)
|
|||||||
|
|
||||||
/* close decoder for each stream */
|
/* close decoder for each stream */
|
||||||
for (i = 0; i < ifile->nb_streams; i++)
|
for (i = 0; i < ifile->nb_streams; i++)
|
||||||
if (ifile->streams[i].st->codecpar->codec_id != AV_CODEC_ID_NONE)
|
avcodec_free_context(&ifile->streams[i].dec_ctx);
|
||||||
avcodec_free_context(&ifile->streams[i].dec_ctx);
|
|
||||||
|
|
||||||
av_freep(&ifile->streams);
|
av_freep(&ifile->streams);
|
||||||
ifile->nb_streams = 0;
|
ifile->nb_streams = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user