[FFmpeg-cvslog] sanm: fix undefined behaviour on big-endian.

Reimar Döffinger git at videolan.org
Sun Aug 11 19:32:29 CEST 2013


ffmpeg | branch: master | Reimar Döffinger <Reimar.Doeffinger at gmx.de> | Sun Aug 11 11:06:41 2013 +0200| [49cf36f4e3e9183611859af1a07dc6a82ab47288] | committer: Reimar Döffinger

sanm: fix undefined behaviour on big-endian.

A variable with post-increment may only appear
once in a statement.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=49cf36f4e3e9183611859af1a07dc6a82ab47288
---

 libavcodec/sanm.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c
index e6e866e..d1ef0ce 100644
--- a/libavcodec/sanm.c
+++ b/libavcodec/sanm.c
@@ -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;



More information about the ffmpeg-cvslog mailing list