From 3c24d5628ff39af7f6c6d8b9484e4fc0be791ab9 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Wed, 9 Apr 2025 14:47:35 +0200
Subject: [PATCH] avcodec/avcodec: Remove always-false check

avcodec_free_context() only calls ff_codec_close() if there
is an AVCodecContext and avcodec_open2() unconditionally
dereferences the AVCodecContext*.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/avcodec.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c
index c7f75b3e89..7bcb0295e5 100644
--- a/libavcodec/avcodec.c
+++ b/libavcodec/avcodec.c
@@ -429,9 +429,6 @@ av_cold void ff_codec_close(AVCodecContext *avctx)
 {
     int i;
 
-    if (!avctx)
-        return;
-
     if (avcodec_is_open(avctx)) {
         AVCodecInternal *avci = avctx->internal;
 
-- 
2.45.2