SDL_RegisterEvents() now rejects requests for numevents <= 0.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 08 Aug 2013 15:04:30 -0700
changeset 7611 ed6f4b8557e4
parent 7610 b043c5c726c1
child 7612 627d571587d3
SDL_RegisterEvents() now rejects requests for numevents <= 0.
src/events/SDL_events.c
--- a/src/events/SDL_events.c	Thu Aug 08 13:29:44 2013 -0700
+++ b/src/events/SDL_events.c	Thu Aug 08 15:04:30 2013 -0700
@@ -599,7 +599,7 @@
 {
     Uint32 event_base;
 
-    if (SDL_userevents+numevents <= SDL_LASTEVENT) {
+    if ((numevents > 0) && (SDL_userevents+numevents <= SDL_LASTEVENT)) {
         event_base = SDL_userevents;
         SDL_userevents += numevents;
     } else {