diff options
author | Mans Rullgard <mans@mansr.com> | 2011-10-08 01:59:51 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-11-04 01:02:03 +0100 |
commit | f65e396aa13925f125c320895d4b9eda241fbba6 (patch) | |
tree | 0f66fdb3e224c3318acd3aaf6569d2ddd51feac7 /libavutil | |
parent | 115d88c4b218a2659a5ed9437407ddeda0a7e32e (diff) | |
download | ffmpeg-f65e396aa13925f125c320895d4b9eda241fbba6.tar.gz |
crc: fix signed overflow
This fixes a signed overflow from i << 24 when i == 255 by
making i unsigned. The result of the shift is already
assigned to an variable of unsigned type.
Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit 8b19ae07616bbd18969b94cbf5d74308a8f2bbdf)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/crc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/crc.c b/libavutil/crc.c index c3d74a2ce9..d0e736ed4d 100644 --- a/libavutil/crc.c +++ b/libavutil/crc.c @@ -57,7 +57,7 @@ static AVCRC av_crc_table[AV_CRC_MAX][257]; * @return <0 on failure */ int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size){ - int i, j; + unsigned i, j; uint32_t c; if (bits < 8 || bits > 32 || poly >= (1LL<<bits)) |