History

avcodec/vp9: fix leaked cbs fragment AVBufferRef

When this function returns, the fragment is never reset, so current_frag->data_ref is never unref-ed, which ends up leaking it. We call ff_cbs_fragment_reset to release the reference on its buffer.

Leo Izen committed 1 year ago

Commit a8fdfdd1 parent 89849ca1 file · +2 −2Browse files

Unified · Split

libavcodec/vp9.c+2−2
@@ -1679,8 +1679,6 @@ static int vp9_decode_frame(AVCodecContext *avctx, AVFrame *frame, · 1678 unmodified lines
1679 &s->s.frames[CUR_FRAME] : &s->s.ref_frames[i]);1679 &s->s.frames[CUR_FRAME] : &s->s.ref_frames[i]);
1680 }1680 }
1681 1681
1682 ff_cbs_fragment_reset(&s->current_frag);
1683
1684 goto finish;1682 goto finish;
1685 }1683 }
1686 1684
@@ -1805,6 +1803,8 @@ static int vp9_decode_frame(AVCodecContext *avctx, AVFrame *frame, · 118 unmodified lines
1805 }1803 }
1806 1804
1807finish:1805finish:
1806 ff_cbs_fragment_reset(&s->current_frag);
1807
1808 ff_progress_frame_report(&s->s.frames[CUR_FRAME].tf, INT_MAX);1808 ff_progress_frame_report(&s->s.frames[CUR_FRAME].tf, INT_MAX);
1809 // ref frame setup1809 // ref frame setup
1810 for (int i = 0; i < 8; i++)1810 for (int i = 0; i < 8; i++)

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