Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-02-19 23:43:45 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-10 17:04:26 +0300
commit41903a9dd222f97e7a20fd22481267483e554964 (patch)
tree06e42533309ec4474984f5a74873bc7bc00037bf /libavfilter
parent73947ed459825c0a8442340baa5589bce6642010 (diff)
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> (cherry picked from commit 1cf96ce269364e3c2b4ec2097f121ad42b336839) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_scale.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
index 7aebf56ad8..42485b281a 100644
--- a/libavfilter/vf_scale.c
+++ b/libavfilter/vf_scale.c
@@ -388,8 +388,8 @@ static int scale_slice(AVFilterLink *link, AVFrame *out_buf, AVFrame *cur_pic, s
int vsub= ((i+1)&2) ? scale->vsub : 0;
in_stride[i] = cur_pic->linesize[i] * mul;
out_stride[i] = out_buf->linesize[i] * mul;
- in[i] = cur_pic->data[i] + ((y>>vsub)+field) * cur_pic->linesize[i];
- out[i] = out_buf->data[i] + field * out_buf->linesize[i];
+ in[i] = FF_PTR_ADD(cur_pic->data[i], ((y>>vsub)+field) * cur_pic->linesize[i]);
+ out[i] = FF_PTR_ADD(out_buf->data[i], field * out_buf->linesize[i]);
}
if(scale->input_is_pal)
in[1] = cur_pic->data[1];