[FFmpeg-devel] [PATCH 1/8] cbs_h264: Fix overflow in shifts

Michael Niedermayer michael at niedermayer.cc
Tue Mar 13 02:31:23 EET 2018


On Sun, Mar 11, 2018 at 06:30:14PM +0000, Mark Thompson wrote:
> The type of the result of a shift operation is unaffected by the type of
> the right operand, so some existing code overflows with undefined behaviour
> when the element length is 32.  Add a helper macro to calculate the maximum
> value correctly and then use it everywhere this pattern appears.
> 
> Found-by: Andreas Rheinhardt <andreas.rheinhardt at googlemail.com>
> ---
>  libavcodec/cbs_h264_syntax_template.c | 22 +++++++++++-----------
>  libavcodec/cbs_internal.h             |  4 ++++
>  2 files changed, 15 insertions(+), 11 deletions(-)

should be ok

thx

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

Dictatorship: All citizens are under surveillance, all their steps and
actions recorded, for the politicians to enforce control.
Democracy: All politicians are under surveillance, all their steps and
actions recorded, for the citizens to enforce control.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180313/3b7fd34f/attachment.sig>


More information about the ffmpeg-devel mailing list