diff options
author | Paul B Mahol <onemda@gmail.com> | 2017-02-27 16:15:11 +0300 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2017-02-27 16:17:51 +0300 |
commit | 26a7d6a301b9b6c67153c87d42db145cdc0e57cf (patch) | |
tree | 57dd630e26dccab92d749504808227ce42c44828 /libavcodec/qdrw.c | |
parent | 86ab6b6e08e2982fb5785e0691c0a7e289339ffb (diff) |
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>
Diffstat (limited to 'libavcodec/qdrw.c')
-rw-r--r-- | libavcodec/qdrw.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c index 20e673a515..c92cd85f12 100644 --- a/libavcodec/qdrw.c +++ b/libavcodec/qdrw.c @@ -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; |