sanm: fix undefined behaviour on big-endian.
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Sun, 11 Aug 2013 09:06:41 +0000 (11:06 +0200)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Sun, 11 Aug 2013 17:30:51 +0000 (19:30 +0200)
A variable with post-increment may only appear
once in a statement.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
libavcodec/sanm.c

index e6e866e..d1ef0ce 100644 (file)
@@ -1044,8 +1044,10 @@ static int decode_5(SANMVideoContext *ctx)
 #if HAVE_BIGENDIAN
     npixels = ctx->npixels;
     frm = ctx->frm0;
-    while (npixels--)
-        *frm++ = av_bswap16(*frm);
+    while (npixels--) {
+        *frm = av_bswap16(*frm);
+        frm++;
+    }
 #endif
 
     return 0;