History

avcodec/avcodec: Avoid av_frame_unref(NULL)

It works, but it is not documented to work.

Andreas Rheinhardt committed 4 years ago

Commit 36490511 parent 3a920371 file · +2 −1Browse files

Showing the changes to libavcodec/avcodec.c (1 of 1 file). Show all

Unified · Split

libavcodec/avcodec.c+2−1
@@ -420,6 +420,8 @@ void avcodec_flush_buffers(AVCodecContext *avctx) · 419 unmodified lines
420420 "that doesn't support it\n");
421421 return;
422422 }
423+ if (avci->in_frame)
424+ av_frame_unref(avci->in_frame);
423425 }
424426
425427 avci->draining = 0;
@@ -432,7 +434,6 @@ void avcodec_flush_buffers(AVCodecContext *avctx) · 6 unmodified lines
432434 while (av_fifo_read(avci->pkt_props, avci->last_pkt_props, 1) >= 0)
433435 av_packet_unref(avci->last_pkt_props);
434436
435− av_frame_unref(avci->in_frame);
436437 av_packet_unref(avci->in_pkt);
437438
438439 if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t