aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2016-07-28 13:10:22 +0300
committerMartin Storsjö <martin@martin.st>2016-07-31 22:50:51 +0300
commit25bacd0a0c32ae682e6f411b1ac9020aeaabca72 (patch)
tree2606b9bd0703577075b95be7923c5d9b8598e608 /libavformat
parent7ebdffc353f3f0827864e8e3461fdc00cc243b14 (diff)
downloadffmpeg-25bacd0a0c32ae682e6f411b1ac9020aeaabca72.tar.gz
Don't use expressions with side effects in macro parameters
AV_WB32 can be implemented as a macro that expands its parameters multiple times (in case AV_HAVE_FAST_UNALIGNED isn't set and the compiler doesn't support GCC attributes); make sure not to read multiple times from the source in this case. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/xmv.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/xmv.c b/libavformat/xmv.c
index b2112b0e95..fa391560f0 100644
--- a/libavformat/xmv.c
+++ b/libavformat/xmv.c
@@ -512,8 +512,10 @@ static int xmv_fetch_video_packet(AVFormatContext *s,
* WMV2 is little-endian.
* TODO: This manual swap is of course suboptimal.
*/
- for (i = 0; i < frame_size; i += 4)
- AV_WB32(pkt->data + i, avio_rl32(pb));
+ for (i = 0; i < frame_size; i += 4) {
+ uint32_t val = avio_rl32(pb);
+ AV_WB32(pkt->data + i, val);
+ }
pkt->stream_index = video->stream_index;