diff mbox series

[FFmpeg-devel,6/7] avcodec/mpegvideo: Remove always-false check

Message ID AS8P250MB0744F40DB410D3C26BBEF5688F309@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 7e93fba51fb646529b6d18d83aa15f2fb105cbd7
Headers show
Series [FFmpeg-devel,1/2] avcodec/mpegvideo: Don't initialize H264Chroma ctx unnecessarily | expand


Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Oct. 26, 2022, 2:01 a.m. UTC
This basically reverts cc0380222add8df8ff9b3bd95eaf2b9d8c4c0d11.
At the time of said commit, cleanup on init failure was very
buggy. For codecs with the INIT_CLEANUP cap, the close function
could be called on error even before the private data has been
allocated; and when using frame threading the same could also
happen even without said flag. Some mpegvideo decoders were
affected by the latter.

Yet both of these issues have been fixed long ago, the latter
in commit e9b66175793e5c2af19beefe8e143f6e4901b5df. Therefore
the workaround in ff_mpv_common_end() can be removed.

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


diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index a04d519ccc..99b2d8f6de 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -789,9 +789,6 @@  void ff_mpv_free_context_frame(MpegEncContext *s)
 /* init common structure for both encoder and decoder */
 void ff_mpv_common_end(MpegEncContext *s)
-    if (!s)
-        return;
     if (s->slice_context_count > 1)
         s->slice_context_count = 1;