mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-27 13:10:37 +00:00
avcodec/cbs_av1: Make overread check more robust
When performing a comparison of a signed int and an unsigned int, the signed int is first converted to an unsigned int, so that negative values are being treated as big, positive values. This can become a problem in an overread check, namely when an overread already happened. So change the type of the variable containing the amount of bits that need to be left to signed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
f3333c3c67
commit
1929dd4eff
@ -211,8 +211,8 @@ static int cbs_av1_read_ns(CodedBitstreamContext *ctx, GetBitContext *gbc,
|
||||
uint32_t n, const char *name,
|
||||
const int *subscripts, uint32_t *write_to)
|
||||
{
|
||||
uint32_t w, m, v, extra_bit, value;
|
||||
int position;
|
||||
uint32_t m, v, extra_bit, value;
|
||||
int position, w;
|
||||
|
||||
av_assert0(n > 0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user