summaryrefslogtreecommitdiff
authorMichael Niedermayer <michaelni@gmx.at>2013-10-26 20:08:06 (GMT)
committer Michael Niedermayer <michaelni@gmx.at>2013-10-26 20:08:06 (GMT)
commitf3d0642d35faf43ce027607bb117142b347ee1a4 (patch)
tree45e7ebcd6b1bd36ba48314b646589fd7e6b59b71
parentc78a4169855861a8ac36192f15c456a357a526d6 (diff)
downloadffmpeg-f3d0642d35faf43ce027607bb117142b347ee1a4.zip
ffmpeg-f3d0642d35faf43ce027607bb117142b347ee1a4.tar.gz
ffmpeg-f3d0642d35faf43ce027607bb117142b347ee1a4.tar.bz2
avutil/utils: check that size_t is unsigned
ANSI/ISO C guarantee this, yet there is evidence that there exist platforms where its not so. See: http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_30.html Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat
-rw-r--r--libavutil/utils.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavutil/utils.c b/libavutil/utils.c
index eb87c90..dc84162 100644
--- a/libavutil/utils.c
+++ b/libavutil/utils.c
@@ -40,6 +40,8 @@ unsigned avutil_version(void)
av_assert0(LIBAVUTIL_VERSION_MICRO >= 100);
av_assert0(HAVE_MMX2 == HAVE_MMXEXT);
+ av_assert0(((size_t)-1) > 0); // C gurantees this but if false on a platform we care about revert at least b284e1ffe343d6697fb950d1ee517bafda8a9844
+
if (av_sat_dadd32(1, 2) != 5) {
av_log(NULL, AV_LOG_FATAL, "Libavutil has been build with a broken binutils, please upgrade binutils and rebuild\n");
abort();