Skip to content

Commit

Permalink
avcodec/qdrw: check bytes per scanline for 2bpp images
Browse files Browse the repository at this point in the history
One byte less is read in case of small width.
Closes #6194.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
  • Loading branch information
richardpl committed Feb 27, 2017
1 parent 86ab6b6 commit 26a7d6a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libavcodec/qdrw.c
Expand Up @@ -81,7 +81,10 @@ static int decode_rle_bpp2(AVCodecContext *avctx, AVFrame *p, GetByteContext *gb
int pos = 0;

/* 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)
return AVERROR_INVALIDDATA;

Expand Down

0 comments on commit 26a7d6a

Please sign in to comment.