You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-23 21:54:53 +02:00
avfilter/vf_libplacebo: fix possible segfault when frame mixing
pl_frame_mix_current() will return NULL if all frames are in the future,
but when libplacebo is using a frame mixer with a radius greater than 1,
future frames are expected to already be partially renderered. Instead, use
pl_frame_mix_nearest(), which is guaranteed to give us a valid frame for any
nonempty frame mix.
Fixes: 3091bca3ed
This commit is contained in:
@@ -928,7 +928,8 @@ static int output_frame(AVFilterContext *ctx, int64_t pts)
|
|||||||
struct pl_frame dummy;
|
struct pl_frame dummy;
|
||||||
if (in->qstatus != PL_QUEUE_OK || !in->mix.num_frames)
|
if (in->qstatus != PL_QUEUE_OK || !in->mix.num_frames)
|
||||||
continue;
|
continue;
|
||||||
const struct pl_frame *cur = pl_frame_mix_current(&in->mix);
|
const struct pl_frame *cur = pl_frame_mix_nearest(&in->mix);
|
||||||
|
av_assert1(cur);
|
||||||
update_crops(ctx, in, &dummy, target_pts);
|
update_crops(ctx, in, &dummy, target_pts);
|
||||||
const int x0 = roundf(FFMIN(dummy.crop.x0, dummy.crop.x1)),
|
const int x0 = roundf(FFMIN(dummy.crop.x0, dummy.crop.x1)),
|
||||||
y0 = roundf(FFMIN(dummy.crop.y0, dummy.crop.y1)),
|
y0 = roundf(FFMIN(dummy.crop.y0, dummy.crop.y1)),
|
||||||
|
|||||||
Reference in New Issue
Block a user