comparison src/share/native/sun/awt/splashscreen/splashscreen_gif.c @ 1173:7f4cf1eb7586

6804996: JWS PNG Decoding Integer Overflow [V-flrhat2ln8] Reviewed-by: prr
author bae
date Fri, 20 Feb 2009 13:48:32 +0300
parents 0291de857e51
children 00cd9dc3c2b5
comparison
equal deleted inserted replaced
1:aecbef497d9f 2:a2b4cd93f73a
51 #define NSEXT_LOOP 0x01 // Loop Count field code 51 #define NSEXT_LOOP 0x01 // Loop Count field code
52 52
53 // convert libungif samples to our ones 53 // convert libungif samples to our ones
54 #define MAKE_QUAD_GIF(c,a) MAKE_QUAD((c).Red, (c).Green, (c).Blue, (a)) 54 #define MAKE_QUAD_GIF(c,a) MAKE_QUAD((c).Red, (c).Green, (c).Blue, (a))
55 55
56 #define SAFE_TO_ALLOC(c, sz) \
57 (((c) > 0) && ((sz) > 0) && \
58 ((0xffffffffu / ((unsigned int)(c))) > (unsigned int)(sz)))
59
60 /* stdio FILE* and memory input functions for libungif */ 56 /* stdio FILE* and memory input functions for libungif */
61 int 57 int
62 SplashStreamGifInputFunc(GifFileType * gif, GifByteType * buf, int n) 58 SplashStreamGifInputFunc(GifFileType * gif, GifByteType * buf, int n)
63 { 59 {
64 SplashStream* io = (SplashStream*)gif->UserData; 60 SplashStream* io = (SplashStream*)gif->UserData;