[FFmpeg-devel] [PATCH v3 2/5] avcodec/golomb: Prevent shift by negative number

Michael Niedermayer michael at niedermayer.cc
Tue Jul 28 22:47:18 EEST 2020


On Mon, Jul 27, 2020 at 11:08:07AM +0200, Andreas Rheinhardt wrote:
> 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.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
> ---
> v3: Besides accepting the same range as the uncached version this
> version also consumes bits in case of error like the uncached version.
> Unfortunately it is not possible to always consume the same number of
> bits, because the uncached version will consume 63 bits as soon as all
> valid bits are zero, whereas the cached version will only consume 63
> bits if the next 31 bits are zero.
> 
>  libavcodec/golomb.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

probably ok

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Modern terrorism, a quick summary: Need oil, start war with country that
has oil, kill hundread thousand in war. Let country fall into chaos,
be surprised about raise of fundamantalists. Drop more bombs, kill more
people, be surprised about them taking revenge and drop even more bombs
and strip your own citizens of their rights and freedoms. to be continued
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200728/7a0e4db5/attachment.sig>


More information about the ffmpeg-devel mailing list