From d2d1ada7d539baf5c46e3359bc623eb8606fffd2 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 11 Jul 2013 22:04:16 -0700 Subject: [PATCH] Check the parameters to SDL_UpdateTexture() --- src/render/SDL_render.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 274645ab2..d9bc0f34f 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -764,6 +764,13 @@ SDL_UpdateTexture(SDL_Texture * texture, const SDL_Rect * rect, 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;