summaryrefslogtreecommitdiff
path: root/libavcodec/qtrle.c
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2013-01-30 06:42:17 +0100
committerAnton Khirnov <anton@khirnov.net>2013-02-06 10:21:52 +0100
commit89f11f498b9c15bc71494a11a7ec560f4adf630d (patch)
treed5f7d2f340b0f9ac098b603e8a6fbcdfb7e00239 /libavcodec/qtrle.c
parent685e6f2e3939f124b41c7801cc541dad8252af3d (diff)
qtrle: fix the topmost line for 1bit
Signed-off-by: Anton Khirnov <anton@khirnov.net> CC:libav-stable@libav.org
Diffstat (limited to 'libavcodec/qtrle.c')
-rw-r--r--libavcodec/qtrle.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c
index 32ad5d66b7..5100e318fb 100644
--- a/libavcodec/qtrle.c
+++ b/libavcodec/qtrle.c
@@ -56,13 +56,16 @@ typedef struct QtrleContext {
static void qtrle_decode_1bpp(QtrleContext *s, int row_ptr, int lines_to_change)
{
int rle_code;
- int pixel_ptr = 0;
+ int pixel_ptr;
int row_inc = s->frame.linesize[0];
unsigned char pi0, pi1; /* 2 8-pixel values */
unsigned char *rgb = s->frame.data[0];
int pixel_limit = s->frame.linesize[0] * s->avctx->height;
int skip;
+ row_ptr -= row_inc;
+ pixel_ptr = row_ptr;
+ lines_to_change++;
while (lines_to_change) {
skip = bytestream2_get_byte(&s->g);
rle_code = (signed char)bytestream2_get_byte(&s->g);