qtrle: use bytestream2_get_buffer()
authorPaul B Mahol <onemda@gmail.com>
Wed, 21 Aug 2013 18:57:30 +0000 (18:57 +0000)
committerPaul B Mahol <onemda@gmail.com>
Wed, 21 Aug 2013 19:18:05 +0000 (19:18 +0000)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavcodec/qtrle.c

index 6bf138f..6dfe2ce 100644 (file)
@@ -110,8 +110,8 @@ static void qtrle_decode_1bpp(QtrleContext *s, int row_ptr, int lines_to_change)
             rle_code *= 2;
             CHECK_PIXEL_PTR(rle_code);
 
-            while (rle_code--)
-                rgb[pixel_ptr++] = bytestream2_get_byte(&s->g);
+            bytestream2_get_buffer(&s->g, &rgb[pixel_ptr], rle_code);
+            pixel_ptr += rle_code;
         }
     }
 }
@@ -214,9 +214,8 @@ static void qtrle_decode_8bpp(QtrleContext *s, int row_ptr, int lines_to_change)
                 rle_code *= 4;
                 CHECK_PIXEL_PTR(rle_code);
 
-                while (rle_code--) {
-                    rgb[pixel_ptr++] = bytestream2_get_byte(&s->g);
-                }
+                bytestream2_get_buffer(&s->g, &rgb[pixel_ptr], rle_code);
+                pixel_ptr += rle_code;
             }
         }
         row_ptr += row_inc;