]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/qtrle.c
ape: decode directly to the user-provided AVFrame
[ffmpeg] / libavcodec / qtrle.c
index 32ad5d66b71a4a187747848d782c485e973238a5..5100e318fbb6549c08085b461e57be47a6b226a5 100644 (file)
@@ -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);