[PATCH][CVE-2020-35965]avcodec/exr: Check ymin vs. h

Signed-off-by: appoe <1029040451@qq.com>
This commit is contained in:
appoe 2021-11-04 07:39:33 +00:00
parent 60dbd8db02
commit 5378430c39

View File

@ -1794,7 +1794,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
// Zero out the start if ymin is not 0
for (i = 0; i < planes; i++) {
ptr = picture->data[i];
for (y = 0; y < s->ymin; y++) {
for (y = 0; y < FFMIN(s->ymin, s->h); y++) {
memset(ptr, 0, out_line_size);
ptr += picture->linesize[i];
}