Fixed some Visual Studio analyze warnings

This commit is contained in:
Sam Lantinga 2013-06-15 02:46:32 -07:00
parent 6971a5dd1c
commit de9566518f
3 changed files with 24 additions and 18 deletions

View file

@ -1202,7 +1202,11 @@ SDL_SW_LockYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect,
break;
}
*pixels = swdata->planes[0] + rect->y * swdata->pitches[0] + rect->x * 2;
if (rect) {
*pixels = swdata->planes[0] + rect->y * swdata->pitches[0] + rect->x * 2;
} else {
*pixels = swdata->planes[0];
}
*pitch = swdata->pitches[0];
return 0;
}