diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-04-13 15:40:05 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-04-13 18:03:25 +0200 |
commit | 3649051dc4e1ede5999a7c688864e5a616f985ee (patch) | |
tree | 7f30d661c12656bf54cfdd2dfc2271c815f710a9 /libavcodec/avcodec.c | |
parent | 3a920372a11607a4ea6e5a2c29b0b5dbf08f275c (diff) | |
download | ffmpeg-3649051dc4e1ede5999a7c688864e5a616f985ee.tar.gz |
avcodec/avcodec: Avoid av_frame_unref(NULL)
It works, but it is not documented to work.
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/avcodec.c')
-rw-r--r-- | libavcodec/avcodec.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c index e0f38ac42a..ded6b5b307 100644 --- a/libavcodec/avcodec.c +++ b/libavcodec/avcodec.c @@ -420,6 +420,8 @@ void avcodec_flush_buffers(AVCodecContext *avctx) "that doesn't support it\n"); return; } + if (avci->in_frame) + av_frame_unref(avci->in_frame); } avci->draining = 0; @@ -432,7 +434,6 @@ void avcodec_flush_buffers(AVCodecContext *avctx) while (av_fifo_read(avci->pkt_props, avci->last_pkt_props, 1) >= 0) av_packet_unref(avci->last_pkt_props); - av_frame_unref(avci->in_frame); av_packet_unref(avci->in_pkt); if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME) |