1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-30 02:52:10 +00:00

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).
This commit is contained in:
Uoti Urpala 2011-06-15 00:02:59 +03:00
parent 378ada847c
commit 6d187a73f0

View File

@ -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])