[FFmpeg-cvslog] avcodec/pgssubdec: Fix left shift of 255 by 24 places cannot be represented in type int

Clément Bœsch u at pkh.me
Sat Dec 5 00:13:05 CET 2015


On Fri, Dec 04, 2015 at 10:30:23PM +0100, Michael Niedermayer wrote:
> ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Fri Dec  4 21:38:12 2015 +0100| [4f2419888ba49245761f4ab343679c38e7880cfe] | committer: Michael Niedermayer
> 
> avcodec/pgssubdec: Fix left shift of 255 by 24 places cannot be represented in type int
> 
> Fixes: b293a6479bb4b5286cff24d356bfd955/asan_generic_225c3c9_7819_cc526b657450c6cdef1371b526499626.mkv
> 
> Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> 
> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4f2419888ba49245761f4ab343679c38e7880cfe
> ---
> 
>  libavcodec/pgssubdec.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c
> index 61dc2ad..07a2a78 100644
> --- a/libavcodec/pgssubdec.c
> +++ b/libavcodec/pgssubdec.c
> @@ -33,7 +33,7 @@
>  #include "libavutil/imgutils.h"
>  #include "libavutil/opt.h"
>  
> -#define RGBA(r,g,b,a) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
> +#define RGBA(r,g,b,a) (((unsigned)(a) << 24) | ((r) << 16) | ((g) << 8) | (b))

I feel like I've seen this fix happen many times. And that specific cases
is still lying around at least in 3 other places: windows2linux.h,
libzvbi-teletextdec.c and texturedsp.c

Maybe it's time to refactor it with MK(BE)TAG etc? This macro is
duplicated in like at least 4 files.

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-cvslog/attachments/20151205/a1fec845/attachment.sig>


More information about the ffmpeg-cvslog mailing list