projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0836d48
)
crc: fix signed overflow
author
Mans Rullgard
<mans@mansr.com>
Sat, 8 Oct 2011 00:59:51 +0000
(
01:59
+0100)
committer
Mans Rullgard
<mans@mansr.com>
Sun, 9 Oct 2011 15:53:31 +0000
(16:53 +0100)
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>
libavutil/crc.c
patch
|
blob
|
history
diff --git
a/libavutil/crc.c
b/libavutil/crc.c
index
6c9f928
..
44719ff
100644
(file)
--- 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))