lavc/qdrw: Fix overwrite when reading invalid Quickdraw images.

This commit is contained in:
Carl Eugen Hoyos 2015-05-16 22:51:16 +02:00
parent e609cfd697
commit 1eda55510a
1 changed files with 4 additions and 0 deletions

View File

@ -95,6 +95,8 @@ static int decode_rle(AVCodecContext *avctx, AVFrame *p, GetByteContext *gbc,
pos -= offset;
pos++;
}
if (pos >= offset)
return AVERROR_INVALIDDATA;
}
left -= 2;
} else { /* copy */
@ -105,6 +107,8 @@ static int decode_rle(AVCodecContext *avctx, AVFrame *p, GetByteContext *gbc,
pos -= offset;
pos++;
}
if (pos >= offset)
return AVERROR_INVALIDDATA;
}
left -= 2 + code;
}