aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/common.h
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2011-11-24 23:15:59 +0000
committerMans Rullgard <mans@mansr.com>2011-11-25 00:20:03 +0000
commit6b34fbba9b73e1914d56c2aff96356326002430d (patch)
tree113c6b281d52e78fc2853ff97707338e3d7cb8a7 /libavutil/common.h
parent7f1b427018ecff59e0e14031eecc79aac0d91ec8 (diff)
downloadffmpeg-6b34fbba9b73e1914d56c2aff96356326002430d.tar.gz
MK(BE)TAG: avoid undefined shifts
Casting the left-most byte to unsigned avoids an undefined result of the shift by 24 if bit 7 is set. This affects the rm demuxer. Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavutil/common.h')
-rw-r--r--libavutil/common.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavutil/common.h b/libavutil/common.h
index 9691f5bcf8..7e93a1ab47 100644
--- a/libavutil/common.h
+++ b/libavutil/common.h
@@ -218,8 +218,8 @@ static av_always_inline av_const int av_popcount_c(uint32_t x)
return (x + (x >> 16)) & 0x3F;
}
-#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24))
-#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((a) << 24))
+#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))
+#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))
/**
* Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.