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:
Andreas Rheinhardt 2021-05-15 08:51:11 +02:00
parent 3a5412b39e
commit d29541c90a
1 changed files with 1 additions and 2 deletions

View File

@ -3078,8 +3078,7 @@ static void close_input_file(InputFile *ifile)
/* close decoder for each stream */
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);
ifile->nb_streams = 0;