]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/intreadwrite.h
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavutil / intreadwrite.h
index 1849a64661c51ca4e598e5bd8a42c0571fb155ec..09d796c8b8e8921d1b2101e59331f7cb629a2080 100644 (file)
@@ -229,11 +229,11 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
 #endif
 
 #ifndef AV_RB32
-#   define AV_RB32(x)                           \
-    ((((const uint8_t*)(x))[0] << 24) |         \
-     (((const uint8_t*)(x))[1] << 16) |         \
-     (((const uint8_t*)(x))[2] <<  8) |         \
-      ((const uint8_t*)(x))[3])
+#   define AV_RB32(x)                                \
+    (((uint32_t)((const uint8_t*)(x))[0] << 24) |    \
+               (((const uint8_t*)(x))[1] << 16) |    \
+               (((const uint8_t*)(x))[2] <<  8) |    \
+                ((const uint8_t*)(x))[3])
 #endif
 #ifndef AV_WB32
 #   define AV_WB32(p, d) do {                   \
@@ -245,11 +245,11 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
 #endif
 
 #ifndef AV_RL32
-#   define AV_RL32(x)                           \
-    ((((const uint8_t*)(x))[3] << 24) |         \
-     (((const uint8_t*)(x))[2] << 16) |         \
-     (((const uint8_t*)(x))[1] <<  8) |         \
-      ((const uint8_t*)(x))[0])
+#   define AV_RL32(x)                                \
+    (((uint32_t)((const uint8_t*)(x))[3] << 24) |    \
+               (((const uint8_t*)(x))[2] << 16) |    \
+               (((const uint8_t*)(x))[1] <<  8) |    \
+                ((const uint8_t*)(x))[0])
 #endif
 #ifndef AV_WL32
 #   define AV_WL32(p, d) do {                   \