Commit d0b27eab authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '9c221697'

* commit '9c221697':
  tiff: do not overread the source buffer

Conflicts:
	libavcodec/tiff.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents dc318505 9c221697
......@@ -577,15 +577,12 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t *dst, int stride,
code = s->fill_order ? (int8_t) ff_reverse[*src++]: (int8_t) *src++;
if (code >= 0) {
code++;
if (pixels + code > width) {
if (pixels + code > width ||
ssrc + size - src < code) {
av_log(s->avctx, AV_LOG_ERROR,
"Copy went out of bounds\n");
return AVERROR_INVALIDDATA;
}
if (ssrc + size - src < code) {
av_log(s->avctx, AV_LOG_ERROR, "Read went out of bounds\n");
return AVERROR_INVALIDDATA;
}
horizontal_fill(s->bpp * (s->avctx->pix_fmt == AV_PIX_FMT_PAL8),
dst, 1, src, 0, code, pixels);
src += code;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment