[FFmpeg-cvslog] avcodec/mpegvideo: Remove always-false check

Andreas Rheinhardt git at videolan.org
Tue Jan 4 18:21:19 EET 2022


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Thu Dec 23 22:56:11 2021 +0100| [ee41c60373fcb8b1d49929367e564020361838da] | committer: Andreas Rheinhardt

avcodec/mpegvideo: Remove always-false check

An AVCodecContext's private data is always allocated
in avcodec_open2() and calling avcodec_flush_buffers()
on an unopened AVCodecContext (or an already closed one)
is not allowed (and will crash before the decoder's flush
function is even called).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ee41c60373fcb8b1d49929367e564020361838da
---

 libavcodec/mpegvideo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 129e0ef647..d34dadf939 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -2318,7 +2318,7 @@ void ff_mpeg_flush(AVCodecContext *avctx){
     int i;
     MpegEncContext *s = avctx->priv_data;
 
-    if (!s || !s->picture)
+    if (!s->picture)
         return;
 
     for (i = 0; i < MAX_PICTURE_COUNT; i++)



More information about the ffmpeg-cvslog mailing list