Re: [FFmpeg-devel] [PATCH 03/10] avcodec/cbs_av1: Fix potential undefined shift

2019-09-29 Thread Mark Thompson
On 18/09/2019 04:26, Andreas Rheinhardt wrote: > 1 << w is undefined as soon as w is >= 31, as 1 has type int. In the > case of cbs_av1_read_ns, w could potentially even be 32, so one has to > use a 64bit type. > > (None of the current callers ever use arguments that are so large that > the above

[FFmpeg-devel] [PATCH 03/10] avcodec/cbs_av1: Fix potential undefined shift

2019-09-17 Thread Andreas Rheinhardt
1 << w is undefined as soon as w is >= 31, as 1 has type int. In the case of cbs_av1_read_ns, w could potentially even be 32, so one has to use a 64bit type. (None of the current callers ever use arguments that are so large that the above scenario can happen, but this might change in the future.)