avcodec/qdrw: consume bytes when end is reached for 8bpp case
authorPaul B Mahol <onemda@gmail.com>
Mon, 27 Feb 2017 11:04:15 +0000 (12:04 +0100)
committerPaul B Mahol <onemda@gmail.com>
Mon, 27 Feb 2017 11:04:15 +0000 (12:04 +0100)
This should really be part of previous commit.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavcodec/qdrw.c

index 975e440..20e673a 100644 (file)
@@ -242,8 +242,9 @@ static int decode_rle(AVCodecContext *avctx, AVFrame *p, GetByteContext *gbc,
                 left  -= 2;
             } else { /* copy */
                 for (j = 0; j < code + 1; j++) {
+                    pix = bytestream2_get_byte(gbc);
                     if (pos < offset)
-                        out[pos] = bytestream2_get_byte(gbc);
+                        out[pos] = pix;
                     pos += step;
                     if (pos >= offset && step > 1) {
                         pos -= offset;