History

avcodec/mpegvideo_enc: Dont copy beyond the image

Fixes: out of array access Fixes: tickets/10754/poc17ffmpeg Discovered by Zeng Yunxiang.

Michael Niedermayer committed 2 years ago

Commit a066b8a1 parent 68146f01 file · +1 −1Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/mpegvideo_enc.c+1−1
@@ -1212,7 +1212,7 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg) · 1211 unmodified lines
1212 dst += INPLACE_OFFSET;1212 dst += INPLACE_OFFSET;
1213 1213
1214 if (src_stride == dst_stride)1214 if (src_stride == dst_stride)
1215 memcpy(dst, src, src_stride * h);1215 memcpy(dst, src, src_stride * h - src_stride + w);
1216 else {1216 else {
1217 int h2 = h;1217 int h2 = h;
1218 uint8_t *dst2 = dst;1218 uint8_t *dst2 = dst;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t