Re: [FFmpeg-devel] [PATCH 09/21] avcodec/smacker: Use unsigned for shift

2020-08-01 Thread Paul B Mahol
lgtm On 8/1/20, Andreas Rheinhardt wrote: > Given that the code currently accepts only 27 bits long Huffman codes, > the shift 1 << (length - 1) with length in 1..28 that is performed when > parsing the tree is safe. Yet if this limit were ever expanded to the > full 32 bits, this shift would be

[FFmpeg-devel] [PATCH 09/21] avcodec/smacker: Use unsigned for shift

2020-08-01 Thread Andreas Rheinhardt
Given that the code currently accepts only 27 bits long Huffman codes, the shift 1 << (length - 1) with length in 1..28 that is performed when parsing the tree is safe. Yet if this limit were ever expanded to the full 32 bits, this shift would be potentially undefined. So simply use unsigned. Sign