avcodec/utils: Remove always-true check

The first thing avcodec_open2() allocates is the AVCodecInternal. If
allocating it fails, a jump to end occurs; but if an error happens after
its allocation, a jump to free_and_end happens which frees all
allocations performed so far and then jumps to end. Yet free_and_end
contained a check for AVCodecInternal (after having already dereferenced
it to check whether ff_thread_free() needs to be called) which is of
course always true. So remove it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
Andreas Rheinhardt 2020-09-24 23:24:20 +02:00
parent 33b4b788aa
commit 502c5fe101
1 changed files with 1 additions and 2 deletions

View File

@ -1043,7 +1043,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
av_dict_free(&tmp);
av_freep(&avctx->priv_data);
av_freep(&avctx->subtitle_header);
if (avci) {
av_frame_free(&avci->to_free);
av_frame_free(&avci->compat_decode_frame);
av_frame_free(&avci->buffer_frame);
@ -1056,7 +1056,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
av_bsf_free(&avci->bsf);
av_buffer_unref(&avci->pool);
}
av_freep(&avci);
avctx->internal = NULL;
avctx->codec = NULL;