pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/SDL Fixed patch-src_video_SDL__pixels.c for NetB...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/9ec8d9938e09
branches:  trunk
changeset: 398614:9ec8d9938e09
user:      micha <micha%pkgsrc.org@localhost>
date:      Wed Jul 24 14:08:23 2019 +0000

description:
Fixed patch-src_video_SDL__pixels.c for NetBSD 7

Declaration of local variable 'byte' moved out of for loop because this syntax
requires C99 (breaks e.g. NetBSD 7 because LANGUAGES= c99 is not defined by
package).

diffstat:

 devel/SDL/distinfo                              |   4 ++--
 devel/SDL/patches/patch-src_video_SDL__pixels.c |  11 ++++++++---
 2 files changed, 10 insertions(+), 5 deletions(-)

diffs (53 lines):

diff -r 2a8f6e9739f4 -r 9ec8d9938e09 devel/SDL/distinfo
--- a/devel/SDL/distinfo        Wed Jul 24 14:01:09 2019 +0000
+++ b/devel/SDL/distinfo        Wed Jul 24 14:08:23 2019 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.81 2019/07/21 11:14:38 nia Exp $
+$NetBSD: distinfo,v 1.82 2019/07/24 14:08:23 micha Exp $
 
 SHA1 (SDL-1.2.15.tar.gz) = 0c5f193ced810b0d7ce3ab06d808cbb5eef03a2c
 RMD160 (SDL-1.2.15.tar.gz) = d4802a090cb4a24eeb0c8ce5690802f596d394c3
@@ -12,7 +12,7 @@
 SHA1 (patch-src_audio_sun_SDL__sunaudio.c) = 4b492b40d39e6444037dfda55766e4a149cc6c30
 SHA1 (patch-src_joystick_bsd_SDL__sysjoystick.c) = a20608d6a4cc8f2c8f5fb2d77a572f373178151b
 SHA1 (patch-src_video_SDL__bmp.c) = 87b14ee02315703479ce522299ffe8d9e83d7e06
-SHA1 (patch-src_video_SDL__pixels.c) = 4a6522ddfc370b2b7e216b79ea3b16a732ab9603
+SHA1 (patch-src_video_SDL__pixels.c) = e4c1feeda33cdd5e891ff203c573c5f578d17368
 SHA1 (patch-src_video_nanox_SDL__nxvideo.c) = 653ff4358d62f7093f646fba5ddae2921876144c
 SHA1 (patch-src_video_quartz_SDL__QuartzVideo.h) = 19d952bade06dbd646e94f42139c38436969b1a8
 SHA1 (patch-src_video_wscons_SDL__wsconsevents.c) = 1c874c46edb325907eda3bfa7580c788294f6d21
diff -r 2a8f6e9739f4 -r 9ec8d9938e09 devel/SDL/patches/patch-src_video_SDL__pixels.c
--- a/devel/SDL/patches/patch-src_video_SDL__pixels.c   Wed Jul 24 14:01:09 2019 +0000
+++ b/devel/SDL/patches/patch-src_video_SDL__pixels.c   Wed Jul 24 14:08:23 2019 +0000
@@ -1,11 +1,15 @@
-$NetBSD: patch-src_video_SDL__pixels.c,v 1.1 2019/07/21 11:14:38 nia Exp $
+$NetBSD: patch-src_video_SDL__pixels.c,v 1.2 2019/07/24 14:08:23 micha Exp $
 
 CVE-2019-7637: Fix in integer overflow in SDL_CalculatePitch
 From https://hg.libsdl.org/SDL/rev/9b0e5c555c0f
 
+Local variable 'byte':
+Declaration moved out of for loop because this syntax requires C99
+(breaks e.g. NetBSD 7 because LANGUAGES= c99 is not defined by package)
+
 --- src/video/SDL_pixels.c.orig        2012-01-19 06:30:06.000000000 +0000
 +++ src/video/SDL_pixels.c
-@@ -286,26 +286,53 @@ void SDL_DitherColors(SDL_Color *colors,
+@@ -286,26 +286,54 @@ void SDL_DitherColors(SDL_Color *colors,
        }
  }
  /* 
@@ -17,11 +21,12 @@
  {
 -      Uint16 pitch;
 +      unsigned int pitch = 0;
++      Uint8 byte;  // Requires C99 if defined inside for loop
  
        /* Surface should be 4-byte aligned for speed */
 -      pitch = surface->w*surface->format->BytesPerPixel;
 +      /* The code tries to prevent from an Uint16 overflow. */;
-+      for (Uint8 byte = surface->format->BytesPerPixel; byte; byte--) {
++      for (byte = surface->format->BytesPerPixel; byte; byte--) {
 +              pitch += (unsigned int)surface->w;
 +              if (pitch < surface->w) {
 +                      SDL_SetError("A scanline is too wide");



Home | Main Index | Thread Index | Old Index