Check the parameters to SDL_UpdateTexture()
authorSam Lantinga <slouken@libsdl.org>
Thu, 11 Jul 2013 22:04:16 -0700
changeset 7409 8b5ae6ff6a49
parent 7408 c50e165abfdf
child 7410 a9878830f05e
Check the parameters to SDL_UpdateTexture()
src/render/SDL_render.c
--- a/src/render/SDL_render.c	Thu Jul 11 21:51:09 2013 -0700
+++ b/src/render/SDL_render.c	Thu Jul 11 22:04:16 2013 -0700
@@ -764,6 +764,13 @@
 
     CHECK_TEXTURE_MAGIC(texture, -1);
 
+    if (!pixels) {
+        return SDL_InvalidParamError("pixels");
+    }
+    if (!pitch) {
+        return SDL_InvalidParamError("pitch");
+    }
+
     if (!rect) {
         full_rect.x = 0;
         full_rect.y = 0;