changeset 8689:59c2ae15dbb1 libavcodec

avoid indeterminate order of accessing src
author stefang
date Fri, 30 Jan 2009 06:38:46 +0000
parents 5cf9f2f663b0
children 6c220a238087
files adpcm.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/adpcm.c	Thu Jan 29 22:08:32 2009 +0000
+++ b/adpcm.c	Fri Jan 30 06:38:46 2009 +0000
@@ -1300,9 +1300,9 @@
         }
 
         for (channel=0; channel<avctx->channels; channel++) {
-            srcC = src + (big_endian ? bytestream_get_be32(&src)
-                                     : bytestream_get_le32(&src))
-                       + (avctx->channels-channel-1) * 4;
+            srcC  = src + (avctx->channels-channel) * 4;
+            srcC += (big_endian ? bytestream_get_be32(&src)
+                                : bytestream_get_le32(&src));
             samplesC = samples + channel;
 
             if (avctx->codec->id == CODEC_ID_ADPCM_EA_R1) {