mirror of https://github.com/encounter/SDL.git
Drop out of SDL_UpdateTexture() early if the rectangle is zero pixels.
Hopefully makes static analysis happy about a zero-byte malloc elsewhere.
This commit is contained in:
parent
2e2b84fb32
commit
d5a578531b
|
@ -820,7 +820,9 @@ SDL_UpdateTexture(SDL_Texture * texture, const SDL_Rect * rect,
|
||||||
rect = &full_rect;
|
rect = &full_rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (texture->yuv) {
|
if ((rect->w == 0) || (rect->h == 0)) {
|
||||||
|
return 0; /* nothing to do. */
|
||||||
|
} else if (texture->yuv) {
|
||||||
return SDL_UpdateTextureYUV(texture, rect, pixels, pitch);
|
return SDL_UpdateTextureYUV(texture, rect, pixels, pitch);
|
||||||
} else if (texture->native) {
|
} else if (texture->native) {
|
||||||
return SDL_UpdateTextureNative(texture, rect, pixels, pitch);
|
return SDL_UpdateTextureNative(texture, rect, pixels, pitch);
|
||||||
|
|
Loading…
Reference in New Issue