diff options
author | Uoti Urpala <uau@mplayer2.org> | 2011-06-15 00:02:59 +0300 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-06-15 00:10:47 +0300 |
commit | 6d187a73f0a56c79d73831eb90bf9a38e98dba6b (patch) | |
tree | 558c9e58fb9bef845edc8a88234270b455dd51a7 | |
parent | 378ada847c8eb3a641392691b1a2317f8fc214e0 (diff) | |
download | mpv-6d187a73f0a56c79d73831eb90bf9a38e98dba6b.tar.bz2 mpv-6d187a73f0a56c79d73831eb90bf9a38e98dba6b.tar.xz |
ffmpeg_files/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 (AV_RL32 used in demux_asf.c timestamp parsing code). Fix
by adding a cast to uint32_t. This code comes from FFmpeg, and the
matching code in Libav/FFmpeg is still broken (but not used there in
most common configurations).
-rw-r--r-- | ffmpeg_files/intreadwrite.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ffmpeg_files/intreadwrite.h b/ffmpeg_files/intreadwrite.h index ff4e917e46..73eaa1badf 100644 --- a/ffmpeg_files/intreadwrite.h +++ b/ffmpeg_files/intreadwrite.h @@ -44,7 +44,7 @@ #endif #ifndef AV_RB32 -#define AV_RB32(x) ((((const uint8_t*)(x))[0] << 24) | \ +#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]) @@ -58,7 +58,7 @@ #endif #ifndef AV_RL32 -#define AV_RL32(x) ((((const uint8_t*)(x))[3] << 24) | \ +#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]) |