avcodec/qdrw: check bytes per scanline for 2bpp images

One byte less is read in case of small width.
Closes #6194.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
pull/233/merge
Paul B Mahol 8 years ago
parent 86ab6b6e08
commit 26a7d6a301
  1. 5
      libavcodec/qdrw.c

@ -81,7 +81,10 @@ static int decode_rle_bpp2(AVCodecContext *avctx, AVFrame *p, GetByteContext *gb
int pos = 0; int pos = 0;
/* size of packed line */ /* size of packed line */
size = left = bytestream2_get_be16(gbc); if (offset / 4 > 200)
size = left = bytestream2_get_be16(gbc);
else
size = left = bytestream2_get_byte(gbc);
if (bytestream2_get_bytes_left(gbc) < size) if (bytestream2_get_bytes_left(gbc) < size)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;

Loading…
Cancel
Save