mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-23 23:21:06 +01:00
avfilter/vf_xfade_opencl: Check ff_inlink_consume_frame() for failure
Fixes: CID1458127 Unchecked return value
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 43b62b7e0c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
dd1058a7b4
commit
d392adb19a
1 changed files with 11 additions and 3 deletions
|
|
@ -293,7 +293,9 @@ static int xfade_opencl_activate(AVFilterContext *avctx)
|
|||
if (ctx->first_pts + ctx->offset_pts > ctx->xf[0]->pts) {
|
||||
ctx->xf[0] = NULL;
|
||||
ctx->need_second = 0;
|
||||
ff_inlink_consume_frame(avctx->inputs[0], &in);
|
||||
ret = ff_inlink_consume_frame(avctx->inputs[0], &in);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
return ff_filter_frame(outlink, in);
|
||||
}
|
||||
|
||||
|
|
@ -302,8 +304,14 @@ static int xfade_opencl_activate(AVFilterContext *avctx)
|
|||
}
|
||||
|
||||
if (ctx->xf[0] && ff_inlink_queued_frames(avctx->inputs[1]) > 0) {
|
||||
ff_inlink_consume_frame(avctx->inputs[0], &ctx->xf[0]);
|
||||
ff_inlink_consume_frame(avctx->inputs[1], &ctx->xf[1]);
|
||||
ret = ff_inlink_consume_frame(avctx->inputs[0], &ctx->xf[0]);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
ret = ff_inlink_consume_frame(avctx->inputs[1], &ctx->xf[1]);
|
||||
if (ret < 0) {
|
||||
av_frame_free(&ctx->xf[0]);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ctx->last_pts = ctx->xf[1]->pts;
|
||||
ctx->pts = ctx->xf[0]->pts;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue