mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/wavpackenc: Use unsigned for potential 31bit shift
Fixes: CID1465481 Unintentional integer overflow
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6f976db251
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
a7ac6a5cfc
commit
b48f33a17c
|
@ -1976,7 +1976,7 @@ static void encode_flush(WavPackEncodeContext *s)
|
||||||
put_bits(pb, 31, 0x7FFFFFFF);
|
put_bits(pb, 31, 0x7FFFFFFF);
|
||||||
cbits -= 31;
|
cbits -= 31;
|
||||||
} else {
|
} else {
|
||||||
put_bits(pb, cbits, (1 << cbits) - 1);
|
put_bits(pb, cbits, (1U << cbits) - 1);
|
||||||
cbits = 0;
|
cbits = 0;
|
||||||
}
|
}
|
||||||
} while (cbits);
|
} while (cbits);
|
||||||
|
@ -2005,7 +2005,7 @@ static void encode_flush(WavPackEncodeContext *s)
|
||||||
put_bits(pb, 31, 0x7FFFFFFF);
|
put_bits(pb, 31, 0x7FFFFFFF);
|
||||||
cbits -= 31;
|
cbits -= 31;
|
||||||
} else {
|
} else {
|
||||||
put_bits(pb, cbits, (1 << cbits) - 1);
|
put_bits(pb, cbits, (1U << cbits) - 1);
|
||||||
cbits = 0;
|
cbits = 0;
|
||||||
}
|
}
|
||||||
} while (cbits);
|
} while (cbits);
|
||||||
|
|
Loading…
Reference in New Issue