History

avfilter/vf_blend: fix un-checked potential memory allocation failure

Wu Jianhua committed 4 years ago

Commit 49250b51 parent aa8bb051 file · +5 −1Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/vf_blend.c+5−1
@@ -279,7 +279,11 @@ static AVFrame *blend_frame(AVFilterContext *ctx, AVFrame *top_buf, · 278 unmodified lines
279279 dst_buf = ff_get_video_buffer(outlink, outlink->w, outlink->h);
280280 if (!dst_buf)
281281 return top_buf;
282− av_frame_copy_props(dst_buf, top_buf);
282+
283+ if (av_frame_copy_props(dst_buf, top_buf) < 0) {
284+ av_frame_free(&dst_buf);
285+ return top_buf;
286+ }
283287
284288 for (plane = 0; plane < s->nb_planes; plane++) {
285289 int hsub = plane == 1 || plane == 2 ? s->hsub : 0;

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