Fixes: out of array access Fixes: tickets/10754/poc17ffmpeg Discovered by Zeng Yunxiang.
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -1212,7 +1212,7 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg) · 1211 unmodified lines | ||
| 1212 | 1212 | dst += INPLACE_OFFSET; |
| 1213 | 1213 | |
| 1214 | 1214 | if (src_stride == dst_stride) |
| 1215 | − memcpy(dst, src, src_stride * h); | |
| 1215 | + memcpy(dst, src, src_stride * h - src_stride + w); | |
| 1216 | 1216 | else { |
| 1217 | 1217 | int h2 = h; |
| 1218 | 1218 | uint8_t *dst2 = dst; |