]> git.sesse.net Git - ffmpeg/commit
avcodec/golomb: Prevent shift by negative number
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 10 Jul 2020 13:12:26 +0000 (15:12 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 29 Jul 2020 02:58:48 +0000 (04:58 +0200)
commit69636b443c4f40286135ad9658b5d44a9de4f3a4
tree06a84deb6ee2186a4603435847e07156a1528d9f
parenta45935fe052dbd166283fb703ad64876110d3ef0
avcodec/golomb: Prevent shift by negative number

This happened in get_ue_golomb() if the cached bitstream reader was in
use, because there was no check to handle the case of the read value
not being in the supported range.
For consistency with the uncached bitstream reader and for compliance
with the documentation, every value not in the 0-8190 range is treated as
error although the cached bitstream reader could actually read values in
the range 0..65534 without problems.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/golomb.h