diff --git a/src/camera/SDL_camera.c b/src/camera/SDL_camera.c index 0247e660f49ed..45b35af952a78 100644 --- a/src/camera/SDL_camera.c +++ b/src/camera/SDL_camera.c @@ -747,7 +747,7 @@ const SDL_CameraSpec * const *SDL_GetCameraSupportedFormats(SDL_CameraID instanc int num_specs = device->num_specs; const SDL_CameraSpec **retval = (const SDL_CameraSpec **) SDL_malloc(((num_specs + 1) * sizeof(*retval)) + (num_specs * sizeof (**retval))); if (retval) { - SDL_CameraSpec *specs = (SDL_CameraSpec *)((Uint8 *)retval + ((num_specs + 1) * sizeof(*retval))); + SDL_CameraSpec *specs = (SDL_CameraSpec *)(retval + (num_specs + 1)); SDL_memcpy(specs, device->all_specs, num_specs * sizeof(*specs)); for (i = 0; i < num_specs; ++i) { retval[i] = specs++; diff --git a/src/locale/SDL_locale.c b/src/locale/SDL_locale.c index ef118cac5c974..ca46db56600ba 100644 --- a/src/locale/SDL_locale.c +++ b/src/locale/SDL_locale.c @@ -56,7 +56,7 @@ static const SDL_Locale * const *build_locales_from_csv_string(char *csv, int *c if (!retval) { return NULL; /* oh well */ } - loc = (SDL_Locale *)((Uint8 *)retval + ((num_locales + 1) * sizeof(SDL_Locale *))); + loc = (SDL_Locale *)(retval + (num_locales + 1)); ptr = (char *)(loc + num_locales); SDL_memcpy(ptr, csv, slen);