diff mbox series

[FFmpeg-devel,32/36] avcodec/mpegvideo: Remove always-false check

Message ID AM7PR03MB6660DF60C6514A81C52E54238F7F9@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit ee41c60373fcb8b1d49929367e564020361838da
Headers show
Series [FFmpeg-devel,01/14] avcodec/mjpegenc: Use custom close function directly | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc fail Make fate failed

Commit Message

Andreas Rheinhardt Dec. 24, 2021, 3:23 a.m. UTC
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@outlook.com>
---
 libavcodec/mpegvideo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index c0ba91e864..942952e46b 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++)