提交 8b19ae07 编写于 作者: M Mans Rullgard

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: NMans Rullgard <mans@mansr.com>
上级 0836d48a
......@@ -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))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册