avcodec/mpegvideo_enc: Dont copy beyond the image
Fixes: out of array access
Fixes: tickets/10754/poc17ffmpeg
Discovered by Zeng Yunxiang.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a066b8a809)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
a83c489c02
commit
dce4cf6871
1 changed files with 1 additions and 1 deletions
|
|
@ -1196,7 +1196,7 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
|
|||
dst += INPLACE_OFFSET;
|
||||
|
||||
if (src_stride == dst_stride)
|
||||
memcpy(dst, src, src_stride * h);
|
||||
memcpy(dst, src, src_stride * h - src_stride + w);
|
||||
else {
|
||||
int h2 = h;
|
||||
uint8_t *dst2 = dst;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue