From ee41c60373fcb8b1d49929367e564020361838da Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Thu, 23 Dec 2021 22:56:11 +0100 Subject: [PATCH] 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 --- 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++)