avfilter/scale_npp: fix non-aligned output frame dimensions

This commit is contained in:
Timo Rothenpieler 2021-10-07 17:41:44 +02:00
parent a7be534d8a
commit 2e68ac694c
1 changed files with 4 additions and 1 deletions

View File

@ -475,13 +475,16 @@ static int nppscale_scale(AVFilterContext *ctx, AVFrame *out, AVFrame *in)
src = s->stages[i].frame;
last_stage = i;
}
if (last_stage < 0)
return AVERROR_BUG;
ret = av_hwframe_get_buffer(src->hw_frames_ctx, s->tmp_frame, 0);
if (ret < 0)
return ret;
s->tmp_frame->width = src->width;
s->tmp_frame->height = src->height;
av_frame_move_ref(out, src);
av_frame_move_ref(src, s->tmp_frame);