From 49cf36f4e3e9183611859af1a07dc6a82ab47288 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= Date: Sun, 11 Aug 2013 11:06:41 +0200 Subject: [PATCH] sanm: fix undefined behaviour on big-endian. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A variable with post-increment may only appear once in a statement. Signed-off-by: Reimar Döffinger --- libavcodec/sanm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index e6e866ef8e..d1ef0ce2a1 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;