diff options
author | Uoti Urpala <uau@mplayer2.org> | 2011-06-14 21:53:30 +0000 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-06-16 20:49:19 +0200 |
commit | c98b928fa7dea6418c24a163e7bcd36b0eb922a3 (patch) | |
tree | a541c864f9bf416995945c44c657a40478628312 /libavutil/intreadwrite.h | |
parent | aa15e68721b15f8020da9d392954b343f195f22c (diff) | |
download | ffmpeg-c98b928fa7dea6418c24a163e7bcd36b0eb922a3.tar.gz |
intreadwrite.h: fix AV_RL32/AV_RB32 signedness.
The output type of the AV_RL32/AV_RB32 macros was signed int. The
resulting overflow broke at least some ASF streams with large
timestamps. Fix by adding a cast to uint32_t.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavutil/intreadwrite.h')
-rw-r--r-- | libavutil/intreadwrite.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libavutil/intreadwrite.h b/libavutil/intreadwrite.h index c8489f1138..01eb27804a 100644 --- a/libavutil/intreadwrite.h +++ b/libavutil/intreadwrite.h @@ -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 { \ |