aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-06 15:56:24 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-06 15:57:45 +0100
commit769eba75eeaa6ee013d7d0573764531e674b6d9b (patch)
tree4f05b00113df786611c178c9bfa535bbc36ed819
parent68c0144d028bb65ea93651503b154a056246b03d (diff)
parent89f11f498b9c15bc71494a11a7ec560f4adf630d (diff)
downloadffmpeg-769eba75eeaa6ee013d7d0573764531e674b6d9b.tar.gz
Merge commit '89f11f498b9c15bc71494a11a7ec560f4adf630d'
* commit '89f11f498b9c15bc71494a11a7ec560f4adf630d': qtrle: fix the topmost line for 1bit Conflicts: tests/ref/fate/qtrle-1bit See: 1af91978dbab35ba9fdede187577c00d643ae33b Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--cmdutils.c1
-rw-r--r--libavcodec/qtrle.c8
2 files changed, 5 insertions, 4 deletions
diff --git a/cmdutils.c b/cmdutils.c
index 29a23d7e4f..bd6ad449f7 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -1856,7 +1856,6 @@ static int alloc_buffer(FrameBuffer **pool, AVCodecContext *s, FrameBuffer **pbu
/* XXX this shouldn't be needed, but some tests break without this line
* those decoders are buggy and need to be fixed.
* the following tests fail:
- * qtrle-1bit
*/
memset(buf->base[0], 128, ret);
diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c
index 5acd2eb3ae..c4b387cdc3 100644
--- a/libavcodec/qtrle.c
+++ b/libavcodec/qtrle.c
@@ -56,7 +56,7 @@ 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];
@@ -70,8 +70,10 @@ static void qtrle_decode_1bpp(QtrleContext *s, int row_ptr, int lines_to_change)
* See: https://ffmpeg.org/trac/ffmpeg/ticket/226
* In the following decoding loop, row_ptr will be the position of the
* _next_ row. */
- lines_to_change++;
+ 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);
@@ -79,8 +81,8 @@ static void qtrle_decode_1bpp(QtrleContext *s, int row_ptr, int lines_to_change)
break;
if(skip & 0x80) {
lines_to_change--;
- pixel_ptr = row_ptr + 2 * (skip & 0x7f);
row_ptr += row_inc;
+ pixel_ptr = row_ptr + 2 * (skip & 0x7f);
} else
pixel_ptr += 2 * skip;
CHECK_PIXEL_PTR(0); /* make sure pixel_ptr is positive */