From 6d187a73f0a56c79d73831eb90bf9a38e98dba6b Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Wed, 15 Jun 2011 00:02:59 +0300 Subject: 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). --- ffmpeg_files/intreadwrite.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ffmpeg_files') 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]) -- cgit v1.2.3