History

avfilter/vf_xfade: Check ff_inlink_consume_frame() for failure

Fixes: CID1458043 Unchecked return value

Michael Niedermayer committed 2 years ago

Commit 73ca4e71 parent 23851c91 file · +12 −3Browse files

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

Unified · Split

libavfilter/vf_xfade.c+12−3
@@ -2288,8 +2288,11 @@ static int xfade_activate(AVFilterContext *avctx) · 2287 unmodified lines
2288 // Check if we are not yet transitioning, in which case2288 // Check if we are not yet transitioning, in which case
2289 // just request and forward the input frame.2289 // just request and forward the input frame.
2290 if (s->start_pts > s->pts) {2290 if (s->start_pts > s->pts) {
2291 int ret;
2291 s->passthrough = 1;2292 s->passthrough = 1;
2292 ff_inlink_consume_frame(in_a, &s->xf[0]);2293 ret = ff_inlink_consume_frame(in_a, &s->xf[0]);
2294 if (ret < 0)
2295 return ret;
2293 return ff_filter_frame(outlink, s->xf[0]);2296 return ff_filter_frame(outlink, s->xf[0]);
2294 }2297 }
2295 s->passthrough = 0;2298 s->passthrough = 0;
@@ -2297,8 +2300,14 @@ static int xfade_activate(AVFilterContext *avctx) · 1 unmodified line
2297 // We are transitioning, so we need a frame from second input2300 // We are transitioning, so we need a frame from second input
2298 if (ff_inlink_check_available_frame(in_b)) {2301 if (ff_inlink_check_available_frame(in_b)) {
2299 int ret;2302 int ret;
2300 ff_inlink_consume_frame(avctx->inputs[0], &s->xf[0]);2303 ret = ff_inlink_consume_frame(avctx->inputs[0], &s->xf[0]);
2301 ff_inlink_consume_frame(avctx->inputs[1], &s->xf[1]);2304 if (ret < 0)
2305 return ret;
2306 ret = ff_inlink_consume_frame(avctx->inputs[1], &s->xf[1]);
2307 if (ret < 0) {
2308 av_frame_free(&s->xf[0]);
2309 return ret;
2310 }
2302 2311
2303 // Calculate PTS offset to first input2312 // Calculate PTS offset to first input
2304 if (s->inputs_offset_pts == AV_NOPTS_VALUE)2313 if (s->inputs_offset_pts == AV_NOPTS_VALUE)

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