1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avfilter/vf_scale: Fix adding 0 to NULL (which is UB) in scale_slice()

Found-by: Jeremy Leconte <jleconte@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2021-02-19 21:43:45 +01:00
parent 522a5259e9
commit 1cf96ce269

View File

@ -635,8 +635,8 @@ static int scale_slice(AVFilterLink *link, AVFrame *out_buf, AVFrame *cur_pic, s
int vsub= ((i+1)&2) ? scale->vsub : 0; int vsub= ((i+1)&2) ? scale->vsub : 0;
in_stride[i] = cur_pic->linesize[i] * mul; in_stride[i] = cur_pic->linesize[i] * mul;
out_stride[i] = out_buf->linesize[i] * mul; out_stride[i] = out_buf->linesize[i] * mul;
in[i] = cur_pic->data[i] + ((y>>vsub)+field) * cur_pic->linesize[i]; in[i] = FF_PTR_ADD(cur_pic->data[i], ((y>>vsub)+field) * cur_pic->linesize[i]);
out[i] = out_buf->data[i] + field * out_buf->linesize[i]; out[i] = FF_PTR_ADD(out_buf->data[i], field * out_buf->linesize[i]);
} }
if (scale->input_is_pal) if (scale->input_is_pal)
in[1] = cur_pic->data[1]; in[1] = cur_pic->data[1];