Hello community, here is the log from the commit of package SDL for openSUSE:Factory checked in at 2019-09-05 12:33:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/SDL (Old) and /work/SRC/openSUSE:Factory/.SDL.new.7948 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "SDL" Thu Sep 5 12:33:18 2019 rev:56 rq:726418 version:1.2.15 Changes: -------- --- /work/SRC/openSUSE:Factory/SDL/SDL.changes 2019-03-08 11:59:00.215979259 +0100 +++ /work/SRC/openSUSE:Factory/.SDL.new.7948/SDL.changes 2019-09-05 12:33:22.795584345 +0200 @@ -1,0 +2,26 @@ +Tue Aug 27 08:42:07 UTC 2019 - Dominique Leuenberger <dims...@opensuse.org> + +- Actually apply CVE-2019-7637.patch. + +------------------------------------------------------------------- +Thu Aug 22 19:24:03 UTC 2019 - Michael Gorse <mgo...@suse.com> + +- Add patches for several heap-based buffer overreads: + * CVE-2019-7577.patch (boo#1124800 CVE-2019-7577) + * CVE-2019-7575.patch (boo#1124806 CVE-2019-7575) + * CVE-2019-7574.patch (boo#1124803 CVE-2019-7574) + * CVE-2019-7572.patch (boo#1124806 CVE-2019-7572) + * CVE-2019-7637.patch (boo#1124825 CVE-2019-7637) + * CVE-2019-7578.patch (boo#1125099 boo#1124799 CVE-2019-7578 + CVE-2019-7573) + * CVE-2019-7635.patch (boo#1124827 CVE-2019-7635) + * CVE-2019-7636.patch (boo#1124826 boo#1124824 CVE-2019-7636 + CVE-2019-7638) + * CVE-2019-13616.patch (boo#1141844 CVE-2019-13616) + +------------------------------------------------------------------- +Mon Aug 5 04:22:30 UTC 2019 - Martin Liška <mli...@suse.cz> + +- Do not provide an empty static archive. + +------------------------------------------------------------------- New: ---- CVE-2019-13616.patch CVE-2019-7572.patch CVE-2019-7574.patch CVE-2019-7575.patch CVE-2019-7577.patch CVE-2019-7578.patch CVE-2019-7635.patch CVE-2019-7636.patch CVE-2019-7637.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ SDL.spec ++++++ --- /var/tmp/diff_new_pack.fk6BQQ/_old 2019-09-05 12:33:23.479584211 +0200 +++ /var/tmp/diff_new_pack.fk6BQQ/_new 2019-09-05 12:33:23.483584210 +0200 @@ -38,6 +38,15 @@ Patch2: sdl-lfs.patch Patch3: libsdl-1.2.15-resizing.patch Patch4: SDL-1.2.15-Use-system-glext.h.patch +Patch5: CVE-2019-7577.patch +Patch6: CVE-2019-7575.patch +Patch7: CVE-2019-7574.patch +Patch8: CVE-2019-7572.patch +Patch9: CVE-2019-7578.patch +Patch10: CVE-2019-7635.patch +Patch11: CVE-2019-7636.patch +Patch12: CVE-2019-7637.patch +Patch13: CVE-2019-13616.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf BuildRequires: nasm @@ -100,12 +109,7 @@ library. %prep -%setup -q -%patch0 -%patch1 -%patch2 -%patch -P 3 -p1 -%patch4 -p1 +%autosetup -p1 # remove the file to provide sufficient evidence that we are # not using this file during the build [bnc#508111] rm -f src/joystick/darwin/10.3.9-FIX/IOHIDLib.h @@ -132,6 +136,7 @@ %install %make_install rm -f "%buildroot/%_libdir"/*.la +rm "%buildroot/%_libdir"/libSDLmain.a sed -i -e '/^Libs.private/d' "%buildroot/%_libdir/pkgconfig/sdl.pc" %post -n %lname -p /sbin/ldconfig @@ -148,7 +153,6 @@ %doc docs/index.html docs/html/ docs/images/ %_bindir/sdl-config %_libdir/libSDL.so -%_libdir/libSDLmain.a %_includedir/SDL/ %_datadir/aclocal/ %_mandir/man3/*.3* ++++++ CVE-2019-13616.patch ++++++ diff -r 87d60cae0273 -r ad1bbfbca760 src/video/SDL_bmp.c --- a/src/video/SDL_bmp.c Tue Jun 18 23:31:40 2019 +0100 +++ b/src/video/SDL_bmp.c Tue Jul 30 21:30:24 2019 +0300 @@ -143,6 +143,11 @@ (void) biYPelsPerMeter; (void) biClrImportant; + if (biWidth <= 0 || biHeight == 0) { + SDL_SetError("BMP file with bad dimensions (%dx%d)", biWidth, biHeight); + was_error = SDL_TRUE; + goto done; + } if (biHeight < 0) { topDown = SDL_TRUE; biHeight = -biHeight; ++++++ CVE-2019-7572.patch ++++++ diff --git a/src/audio/SDL_wave.c b/src/audio/SDL_wave.c index 2968b3d..caf41ee 100644 --- a/src/audio/SDL_wave.c +++ b/src/audio/SDL_wave.c @@ -275,6 +275,13 @@ static Sint32 IMA_ADPCM_nibble(struct IMA_ADPCM_decodestate *state,Uint8 nybble) }; Sint32 delta, step; + if ( state->index > 88 ) { + state->index = 88; + } else + if ( state->index < 0 ) { + state->index = 0; + } + /* Compute difference and new sample value */ step = step_table[state->index]; delta = step >> 3; @@ -334,7 +341,7 @@ static void Fill_IMA_ADPCM_block(Uint8 *decoded, Uint8 *encoded, static int IMA_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len) { struct IMA_ADPCM_decodestate *state; - Uint8 *freeable, *encoded, *encoded_end, *decoded; + Uint8 *freeable, *encoded, *encoded_end, *decoded, *decoded_end; Sint32 encoded_len, samplesleft; unsigned int c, channels; @@ -361,7 +368,7 @@ static int IMA_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len) return(-1); } decoded = *audio_buf; - + decoded_end = decoded + *audio_len; /* Get ready... Go! */ while ( encoded_len >= IMA_ADPCM_state.wavefmt.blockalign ) { /* Grab the initial information for this block */ @@ -380,6 +387,7 @@ static int IMA_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len) } /* Store the initial sample we start with */ + if (decoded + 2 > decoded_end) goto invalid_size; decoded[0] = (Uint8)(state[c].sample&0xFF); decoded[1] = (Uint8)(state[c].sample>>8); decoded += 2; @@ -390,6 +398,7 @@ static int IMA_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len) while ( samplesleft > 0 ) { for ( c=0; c<channels; ++c ) { if (encoded + 4 > encoded_end) goto invalid_size; + if (decoded + 4 * 4 * channels > decoded_end) goto invalid_size; Fill_IMA_ADPCM_block(decoded, encoded, c, channels, &state[c]); encoded += 4; ++++++ CVE-2019-7574.patch ++++++ diff --git a/src/audio/SDL_wave.c b/src/audio/SDL_wave.c index b6c49de..2968b3d 100644 --- a/src/audio/SDL_wave.c +++ b/src/audio/SDL_wave.c @@ -334,7 +334,7 @@ static void Fill_IMA_ADPCM_block(Uint8 *decoded, Uint8 *encoded, static int IMA_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len) { struct IMA_ADPCM_decodestate *state; - Uint8 *freeable, *encoded, *decoded; + Uint8 *freeable, *encoded, *encoded_end, *decoded; Sint32 encoded_len, samplesleft; unsigned int c, channels; @@ -350,6 +350,7 @@ static int IMA_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len) /* Allocate the proper sized output buffer */ encoded_len = *audio_len; encoded = *audio_buf; + encoded_end = encoded + encoded_len; freeable = *audio_buf; *audio_len = (encoded_len/IMA_ADPCM_state.wavefmt.blockalign) * IMA_ADPCM_state.wSamplesPerBlock* @@ -365,6 +366,7 @@ static int IMA_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len) while ( encoded_len >= IMA_ADPCM_state.wavefmt.blockalign ) { /* Grab the initial information for this block */ for ( c=0; c<channels; ++c ) { + if (encoded + 4 > encoded_end) goto invalid_size; /* Fill the state information for this block */ state[c].sample = ((encoded[1]<<8)|encoded[0]); encoded += 2; @@ -387,6 +389,7 @@ static int IMA_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len) samplesleft = (IMA_ADPCM_state.wSamplesPerBlock-1)*channels; while ( samplesleft > 0 ) { for ( c=0; c<channels; ++c ) { + if (encoded + 4 > encoded_end) goto invalid_size; Fill_IMA_ADPCM_block(decoded, encoded, c, channels, &state[c]); encoded += 4; @@ -398,6 +401,10 @@ static int IMA_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len) } SDL_free(freeable); return(0); +invalid_size: + SDL_SetError("Unexpected chunk length for an IMA ADPCM decoder"); + SDL_free(freeable); + return(-1); } SDL_AudioSpec * SDL_LoadWAV_RW (SDL_RWops *src, int freesrc, ++++++ CVE-2019-7575.patch ++++++ diff --git a/src/audio/SDL_wave.c b/src/audio/SDL_wave.c index e42d01c..b6c49de 100644 --- a/src/audio/SDL_wave.c +++ b/src/audio/SDL_wave.c @@ -115,7 +115,7 @@ static Sint32 MS_ADPCM_nibble(struct MS_ADPCM_decodestate *state, static int MS_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len) { struct MS_ADPCM_decodestate *state[2]; - Uint8 *freeable, *encoded, *encoded_end, *decoded; + Uint8 *freeable, *encoded, *encoded_end, *decoded, *decoded_end; Sint32 encoded_len, samplesleft; Sint8 nybble, stereo; Sint16 *coeff[2]; @@ -135,6 +135,7 @@ static int MS_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len) return(-1); } decoded = *audio_buf; + decoded_end = decoded + *audio_len; /* Get ready... Go! */ stereo = (MS_ADPCM_state.wavefmt.channels == 2); @@ -142,7 +143,7 @@ static int MS_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len) state[1] = &MS_ADPCM_state.state[stereo]; while ( encoded_len >= MS_ADPCM_state.wavefmt.blockalign ) { /* Grab the initial information for this block */ - if (encoded + 7 + (stereo ? 7 : 0) > encoded_end) goto too_short; + if (encoded + 7 + (stereo ? 7 : 0) > encoded_end) goto invalid_size; state[0]->hPredictor = *encoded++; if ( stereo ) { state[1]->hPredictor = *encoded++; @@ -169,6 +170,7 @@ static int MS_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len) coeff[1] = MS_ADPCM_state.aCoeff[state[1]->hPredictor]; /* Store the two initial samples we start with */ + if (decoded + 4 + (stereo ? 4 : 0) > decoded_end) goto invalid_size; decoded[0] = state[0]->iSamp2&0xFF; decoded[1] = state[0]->iSamp2>>8; decoded += 2; @@ -190,7 +192,8 @@ static int MS_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len) samplesleft = (MS_ADPCM_state.wSamplesPerBlock-2)* MS_ADPCM_state.wavefmt.channels; while ( samplesleft > 0 ) { - if (encoded + 1 > encoded_end) goto too_short; + if (encoded + 1 > encoded_end) goto invalid_size; + if (decoded + 4 > decoded_end) goto invalid_size; nybble = (*encoded)>>4; new_sample = MS_ADPCM_nibble(state[0],nybble,coeff[0]); @@ -213,8 +216,8 @@ static int MS_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len) } SDL_free(freeable); return(0); -too_short: - SDL_SetError("Too short chunk for a MS ADPCM decoder"); +invalid_size: + SDL_SetError("Unexpected chunk length for a MS ADPCM decoder"); SDL_free(freeable); return(-1); } ++++++ CVE-2019-7577.patch ++++++ diff --git a/src/audio/SDL_wave.c b/src/audio/SDL_wave.c index b4ad6c7..e42d01c 100644 --- a/src/audio/SDL_wave.c +++ b/src/audio/SDL_wave.c @@ -115,7 +115,7 @@ static Sint32 MS_ADPCM_nibble(struct MS_ADPCM_decodestate *state, static int MS_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len) { struct MS_ADPCM_decodestate *state[2]; - Uint8 *freeable, *encoded, *decoded; + Uint8 *freeable, *encoded, *encoded_end, *decoded; Sint32 encoded_len, samplesleft; Sint8 nybble, stereo; Sint16 *coeff[2]; @@ -124,6 +124,7 @@ static int MS_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len) /* Allocate the proper sized output buffer */ encoded_len = *audio_len; encoded = *audio_buf; + encoded_end = encoded + encoded_len; freeable = *audio_buf; *audio_len = (encoded_len/MS_ADPCM_state.wavefmt.blockalign) * MS_ADPCM_state.wSamplesPerBlock* @@ -141,6 +142,7 @@ static int MS_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len) state[1] = &MS_ADPCM_state.state[stereo]; while ( encoded_len >= MS_ADPCM_state.wavefmt.blockalign ) { /* Grab the initial information for this block */ + if (encoded + 7 + (stereo ? 7 : 0) > encoded_end) goto too_short; state[0]->hPredictor = *encoded++; if ( stereo ) { state[1]->hPredictor = *encoded++; @@ -188,6 +190,8 @@ static int MS_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len) samplesleft = (MS_ADPCM_state.wSamplesPerBlock-2)* MS_ADPCM_state.wavefmt.channels; while ( samplesleft > 0 ) { + if (encoded + 1 > encoded_end) goto too_short; + nybble = (*encoded)>>4; new_sample = MS_ADPCM_nibble(state[0],nybble,coeff[0]); decoded[0] = new_sample&0xFF; @@ -209,6 +213,10 @@ static int MS_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len) } SDL_free(freeable); return(0); +too_short: + SDL_SetError("Too short chunk for a MS ADPCM decoder"); + SDL_free(freeable); + return(-1); } struct IMA_ADPCM_decodestate { ++++++ CVE-2019-7578.patch ++++++ diff --git a/src/audio/SDL_wave.c b/src/audio/SDL_wave.c index caf41ee..f2e0e33 100644 --- a/src/audio/SDL_wave.c +++ b/src/audio/SDL_wave.c @@ -233,11 +233,12 @@ static struct IMA_ADPCM_decoder { struct IMA_ADPCM_decodestate state[2]; } IMA_ADPCM_state; -static int InitIMA_ADPCM(WaveFMT *format) +static int InitIMA_ADPCM(WaveFMT *format, int length) { - Uint8 *rogue_feel; + Uint8 *rogue_feel, *rogue_feel_end; /* Set the rogue pointer to the IMA_ADPCM specific data */ + if (length < sizeof(*format)) goto too_short; IMA_ADPCM_state.wavefmt.encoding = SDL_SwapLE16(format->encoding); IMA_ADPCM_state.wavefmt.channels = SDL_SwapLE16(format->channels); IMA_ADPCM_state.wavefmt.frequency = SDL_SwapLE32(format->frequency); @@ -246,11 +247,16 @@ static int InitIMA_ADPCM(WaveFMT *format) IMA_ADPCM_state.wavefmt.bitspersample = SDL_SwapLE16(format->bitspersample); rogue_feel = (Uint8 *)format+sizeof(*format); + rogue_feel_end = (Uint8 *)format + length; if ( sizeof(*format) == 16 ) { rogue_feel += sizeof(Uint16); } + if (rogue_feel + 2 > rogue_feel_end) goto too_short; IMA_ADPCM_state.wSamplesPerBlock = ((rogue_feel[1]<<8)|rogue_feel[0]); return(0); +too_short: + SDL_SetError("Unexpected length of a chunk with an IMA ADPCM format"); + return(-1); } static Sint32 IMA_ADPCM_nibble(struct IMA_ADPCM_decodestate *state,Uint8 nybble) @@ -496,7 +502,7 @@ SDL_AudioSpec * SDL_LoadWAV_RW (SDL_RWops *src, int freesrc, break; case IMA_ADPCM_CODE: /* Try to understand this */ - if ( InitIMA_ADPCM(format) < 0 ) { + if ( InitIMA_ADPCM(format, lenread) < 0 ) { was_error = 1; goto done; } ++++++ CVE-2019-7635.patch ++++++ diff --git a/src/video/SDL_bmp.c b/src/video/SDL_bmp.c index d56cfd8..6f6dedf 100644 --- a/src/video/SDL_bmp.c +++ b/src/video/SDL_bmp.c @@ -163,6 +163,14 @@ SDL_Surface * SDL_LoadBMP_RW (SDL_RWops *src, int freesrc) ExpandBMP = biBitCount; biBitCount = 8; break; + case 2: + case 3: + case 5: + case 6: + case 7: + SDL_SetError("%d-bpp BMP images are not supported", biBitCount); + was_error = SDL_TRUE; + goto done; default: ExpandBMP = 0; break; @@ -296,6 +304,11 @@ SDL_Surface * SDL_LoadBMP_RW (SDL_RWops *src, int freesrc) } *(bits+i) = (pixel>>shift); pixel <<= ExpandBMP; + if ( bits[i] >= biClrUsed ) { + SDL_SetError("A BMP image contains a pixel with a color out of the palette"); + was_error = SDL_TRUE; + goto done; + } } } break; @@ -306,6 +319,16 @@ SDL_Surface * SDL_LoadBMP_RW (SDL_RWops *src, int freesrc) was_error = SDL_TRUE; goto done; } + if ( 8 == biBitCount && palette && biClrUsed < (1 << biBitCount ) ) { + for ( i=0; i<surface->w; ++i ) { + if ( bits[i] >= biClrUsed ) { + SDL_SetError( + "A BMP image contains a pixel with a color out of the palette"); + was_error = SDL_TRUE; + goto done; + } + } + } #if SDL_BYTEORDER == SDL_BIG_ENDIAN /* Byte-swap the pixels if needed. Note that the 24bpp case has already been taken care of above. */ ++++++ CVE-2019-7636.patch ++++++ diff --git a/src/video/SDL_bmp.c b/src/video/SDL_bmp.c index 6f6dedf..9700500 100644 --- a/src/video/SDL_bmp.c +++ b/src/video/SDL_bmp.c @@ -241,6 +241,10 @@ SDL_Surface * SDL_LoadBMP_RW (SDL_RWops *src, int freesrc) if ( palette ) { if ( biClrUsed == 0 ) { biClrUsed = 1 << biBitCount; + } else if ( biClrUsed > (1 << biBitCount) ) { + SDL_SetError("BMP file has an invalid number of colors"); + was_error = SDL_TRUE; + goto done; } if ( biSize == 12 ) { for ( i = 0; i < (int)biClrUsed; ++i ) { ++++++ CVE-2019-7637.patch ++++++ diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index 1a7fd51..6448e9b 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -286,26 +286,56 @@ void SDL_DitherColors(SDL_Color *colors, int bpp) } } /* - * Calculate the pad-aligned scanline width of a surface + * Calculate the pad-aligned scanline width of a surface. Return 0 in case of + * an error. */ Uint16 SDL_CalculatePitch(SDL_Surface *surface) { - Uint16 pitch; - + unsigned int pitch = 0; + Uint8 byte = 0; /* Surface should be 4-byte aligned for speed */ - pitch = surface->w*surface->format->BytesPerPixel; + /* The code tries to prevent from an Uint16 overflow. */ + for (byte = surface->format->BytesPerPixel; byte; byte--) { + pitch += (unsigned int)surface->w; + if (pitch < surface->w) { + SDL_SetError("A scanline is too wide"); + return(0); + } + } + switch (surface->format->BitsPerPixel) { case 1: - pitch = (pitch+7)/8; + if (pitch % 8) { + pitch = pitch / 8 + 1; + } else { + pitch = pitch / 8; + } break; case 4: - pitch = (pitch+1)/2; + if (pitch % 2) { + pitch = pitch / 2 + 1; + } else { + pitch = pitch / 2; + } break; default: break; } - pitch = (pitch + 3) & ~3; /* 4-byte aligning */ - return(pitch); + + /* 4-byte aligning */ + if (pitch & 3) { + if (pitch + 3 < pitch) { + SDL_SetError("A scanline is too wide"); + return(0); + } + pitch = (pitch + 3) & ~3; + } + if (pitch > 0xFFFF) { + SDL_SetError("A scanline is too wide"); + return(0); + } + + return((Uint16)pitch); } /* * Match an RGB value to a particular palette index diff --git a/src/video/gapi/SDL_gapivideo.c b/src/video/gapi/SDL_gapivideo.c index 86deadc..8a06485 100644 --- a/src/video/gapi/SDL_gapivideo.c +++ b/src/video/gapi/SDL_gapivideo.c @@ -733,6 +733,9 @@ SDL_Surface *GAPI_SetVideoMode(_THIS, SDL_Surface *current, video->w = gapi->w = width; video->h = gapi->h = height; video->pitch = SDL_CalculatePitch(video); + if (!current->pitch) { + return(NULL); + } /* Small fix for WinCE/Win32 - when activating window SDL_VideoSurface is equal to zero, so activating code diff --git a/src/video/nanox/SDL_nxvideo.c b/src/video/nanox/SDL_nxvideo.c index b188e09..cbdd09a 100644 --- a/src/video/nanox/SDL_nxvideo.c +++ b/src/video/nanox/SDL_nxvideo.c @@ -378,6 +378,10 @@ SDL_Surface * NX_SetVideoMode (_THIS, SDL_Surface * current, current -> w = width ; current -> h = height ; current -> pitch = SDL_CalculatePitch (current) ; + if (!current->pitch) { + current = NULL; + goto done; + } NX_ResizeImage (this, current, flags) ; } diff --git a/src/video/ps2gs/SDL_gsvideo.c b/src/video/ps2gs/SDL_gsvideo.c index e172c60..3290866 100644 --- a/src/video/ps2gs/SDL_gsvideo.c +++ b/src/video/ps2gs/SDL_gsvideo.c @@ -479,6 +479,9 @@ static SDL_Surface *GS_SetVideoMode(_THIS, SDL_Surface *current, current->w = width; current->h = height; current->pitch = SDL_CalculatePitch(current); + if (!current->pitch) { + return(NULL); + } /* Memory map the DMA area for block memory transfer */ if ( ! mapped_mem ) { diff --git a/src/video/ps3/SDL_ps3video.c b/src/video/ps3/SDL_ps3video.c index d5519e0..17848e3 100644 --- a/src/video/ps3/SDL_ps3video.c +++ b/src/video/ps3/SDL_ps3video.c @@ -339,6 +339,9 @@ static SDL_Surface *PS3_SetVideoMode(_THIS, SDL_Surface * current, int width, in current->w = width; current->h = height; current->pitch = SDL_CalculatePitch(current); + if (!current->pitch) { + return(NULL); + } /* Alloc aligned mem for current->pixels */ s_pixels = memalign(16, current->h * current->pitch); diff --git a/src/video/windib/SDL_dibvideo.c b/src/video/windib/SDL_dibvideo.c index 6187bfc..86ebb12 100644 --- a/src/video/windib/SDL_dibvideo.c +++ b/src/video/windib/SDL_dibvideo.c @@ -675,6 +675,9 @@ SDL_Surface *DIB_SetVideoMode(_THIS, SDL_Surface *current, video->w = width; video->h = height; video->pitch = SDL_CalculatePitch(video); + if (!current->pitch) { + return(NULL); + } /* Small fix for WinCE/Win32 - when activating window SDL_VideoSurface is equal to zero, so activating code diff --git a/src/video/windx5/SDL_dx5video.c b/src/video/windx5/SDL_dx5video.c index f80ca97..39fc4fc 100644 --- a/src/video/windx5/SDL_dx5video.c +++ b/src/video/windx5/SDL_dx5video.c @@ -1127,6 +1127,9 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current, video->w = width; video->h = height; video->pitch = SDL_CalculatePitch(video); + if (!current->pitch) { + return(NULL); + } #ifndef NO_CHANGEDISPLAYSETTINGS /* Set fullscreen mode if appropriate. diff --git a/src/video/x11/SDL_x11video.c b/src/video/x11/SDL_x11video.c index 670a2d8..9521b49 100644 --- a/src/video/x11/SDL_x11video.c +++ b/src/video/x11/SDL_x11video.c @@ -1218,6 +1218,10 @@ SDL_Surface *X11_SetVideoMode(_THIS, SDL_Surface *current, current->w = width; current->h = height; current->pitch = SDL_CalculatePitch(current); + if (!current->pitch) { + current = NULL; + goto done; + } if (X11_ResizeImage(this, current, flags) < 0) { current = NULL; goto done; ++++++ SDL-1.2.13-x11-keytounicode.patch ++++++ --- /var/tmp/diff_new_pack.fk6BQQ/_old 2019-09-05 12:33:23.531584200 +0200 +++ /var/tmp/diff_new_pack.fk6BQQ/_new 2019-09-05 12:33:23.531584200 +0200 @@ -1,6 +1,12 @@ ---- src/video/x11/SDL_x11events.c -+++ src/video/x11/SDL_x11events.c -@@ -1223,8 +1223,11 @@ +--- + src/video/x11/SDL_x11events.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +Index: SDL-1.2.15/src/video/x11/SDL_x11events.c +=================================================================== +--- SDL-1.2.15.orig/src/video/x11/SDL_x11events.c ++++ SDL-1.2.15/src/video/x11/SDL_x11events.c +@@ -1246,8 +1246,11 @@ static void get_modifier_masks(Display * * sequences (dead accents, compose key sequences) will not work since the * state has been irrevocably lost. */ @@ -12,7 +18,7 @@ struct SDL_VideoDevice *this = current_video; char keybuf[32]; int i; -@@ -1232,6 +1235,12 @@ +@@ -1255,6 +1258,12 @@ Uint16 X11_KeyToUnicode(SDLKey keysym, S XKeyEvent xkey; Uint16 unicode; ++++++ SDL_sdl_endian.patch ++++++ --- /var/tmp/diff_new_pack.fk6BQQ/_old 2019-09-05 12:33:23.555584196 +0200 +++ /var/tmp/diff_new_pack.fk6BQQ/_new 2019-09-05 12:33:23.559584195 +0200 @@ -1,5 +1,11 @@ ---- include/SDL_endian.h.orig -+++ include/SDL_endian.h +--- + include/SDL_endian.h | 146 +++++---------------------------------------------- + 1 file changed, 15 insertions(+), 131 deletions(-) + +Index: SDL-1.2.15/include/SDL_endian.h +=================================================================== +--- SDL-1.2.15.orig/include/SDL_endian.h ++++ SDL-1.2.15/include/SDL_endian.h @@ -37,12 +37,11 @@ #define SDL_LIL_ENDIAN 1234 #define SDL_BIG_ENDIAN 4321 ++++++ sdl-lfs.patch ++++++ --- /var/tmp/diff_new_pack.fk6BQQ/_old 2019-09-05 12:33:23.571584193 +0200 +++ /var/tmp/diff_new_pack.fk6BQQ/_new 2019-09-05 12:33:23.571584193 +0200 @@ -1,16 +1,12 @@ ---- configure.in.orig -+++ configure.in -@@ -56,6 +56,8 @@ fi - dnl Check for tools - AC_PROG_LIBTOOL - AC_PROG_CC -+AC_USE_SYSTEM_EXTENSIONS -+AC_SYS_LARGEFILE - AC_PROG_CXX - AC_PROG_INSTALL - AC_PROG_MAKE_SET ---- Makefile.in.orig -+++ Makefile.in +--- + Makefile.in | 2 +- + configure.in | 2 ++ + 2 files changed, 3 insertions(+), 1 deletion(-) + +Index: SDL-1.2.15/Makefile.in +=================================================================== +--- SDL-1.2.15.orig/Makefile.in ++++ SDL-1.2.15/Makefile.in @@ -21,7 +21,7 @@ distfile = $(distdir).tar.gz SHELL = @SHELL@ CC = @CC@ @@ -20,3 +16,16 @@ EXTRA_CFLAGS = @EXTRA_CFLAGS@ LDFLAGS = @BUILD_LDFLAGS@ EXTRA_LDFLAGS = @EXTRA_LDFLAGS@ +Index: SDL-1.2.15/configure.in +=================================================================== +--- SDL-1.2.15.orig/configure.in ++++ SDL-1.2.15/configure.in +@@ -56,6 +56,8 @@ fi + dnl Check for tools + AC_PROG_LIBTOOL + AC_PROG_CC ++AC_USE_SYSTEM_EXTENSIONS ++AC_SYS_LARGEFILE + AC_PROG_CXX + AC_PROG_INSTALL + AC_PROG_MAKE_SET