dpxenc: fix padding in encode_gbrp12
authorChristophe Gisquet <christophe.gisquet@gmail.com>
Wed, 20 Aug 2014 08:10:44 +0000 (08:10 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 21 Aug 2014 21:02:48 +0000 (23:02 +0200)
It was added per pixel instead of per line.

Reviewed-by: James Darnley <james.darnley@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/dpxenc.c

index 059d8c6..aca745b 100644 (file)
@@ -159,11 +159,11 @@ static void encode_gbrp12(AVCodecContext *avctx, const AVPicture *pic, uint16_t
                 value[2] = AV_RL16(src[1] + x) << 4;
                 value[0] = AV_RL16(src[2] + x) << 4;
             }
-            for (i = 0; i < pad; i++)
-                *dst++ = 0;
             for (i = 0; i < 3; i++)
                 write16(dst++, value[i]);
         }
+        for (i = 0; i < pad; i++)
+            *dst++ = 0;
         for (i = 0; i < 3; i++)
             src[i] += pic->linesize[i]/2;
     }