History

avfilter/buffersrc: Use av_frame_clone() where appropriate

Andreas Rheinhardt committed 3 years ago

Commit 67cc7aa1 parent 185d0ac1 file · +5 −8Browse files

Unified · Split

libavfilter/buffersrc.c+5−8
@@ -230,17 +230,14 @@ FF_ENABLE_DEPRECATION_WARNINGS · 229 unmodified lines
230230
231231 }
232232
233− if (!(copy = av_frame_alloc()))
234− return AVERROR(ENOMEM);
235−
236233 if (refcounted && !(flags & AV_BUFFERSRC_FLAG_KEEP_REF)) {
234+ if (!(copy = av_frame_alloc()))
235+ return AVERROR(ENOMEM);
237236 av_frame_move_ref(copy, frame);
238237 } else {
239− ret = av_frame_ref(copy, frame);
240− if (ret < 0) {
241− av_frame_free(&copy);
242− return ret;
243− }
238+ copy = av_frame_clone(frame);
239+ if (!copy)
240+ return AVERROR(ENOMEM);
244241 }
245242
246243 #if FF_API_PKT_DURATION

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