mirror of
https://github.com/yawut/SDL.git
synced 2026-07-06 02:28:37 -05:00
Don't crash if we are asked to convert a surface to a NULl buffer.
This commit is contained in:
parent
3104ca4190
commit
bb183a5c79
|
|
@ -935,6 +935,16 @@ int SDL_ConvertPixels(int width, int height,
|
|||
SDL_Rect rect;
|
||||
void *nonconst_src = (void *) src;
|
||||
|
||||
/* Check to make sure we are bliting somewhere, so we don't crash */
|
||||
if (!dst) {
|
||||
SDL_InvalidParamError("dst");
|
||||
return -1;
|
||||
}
|
||||
if (!dst_pitch) {
|
||||
SDL_InvalidParamError("dst_pitch");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Fast path for same format copy */
|
||||
if (src_format == dst_format) {
|
||||
int bpp;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user