src/render/SDL_render.c
changeset 9078 230e7558f76a
parent 8728 c7174f961388
child 9084 a8cbb653aea4
equal deleted inserted replaced
9077:28e6de55eb07 9078:230e7558f76a
   538         SDL_PixelFormat *dst_fmt;
   538         SDL_PixelFormat *dst_fmt;
   539         SDL_Surface *temp = NULL;
   539         SDL_Surface *temp = NULL;
   540 
   540 
   541         /* Set up a destination surface for the texture update */
   541         /* Set up a destination surface for the texture update */
   542         dst_fmt = SDL_AllocFormat(format);
   542         dst_fmt = SDL_AllocFormat(format);
       
   543         if (!dst_fmt) {
       
   544            SDL_DestroyTexture(texture);
       
   545            return NULL;
       
   546         }
   543         temp = SDL_ConvertSurface(surface, dst_fmt, 0);
   547         temp = SDL_ConvertSurface(surface, dst_fmt, 0);
   544         SDL_FreeFormat(dst_fmt);
   548         SDL_FreeFormat(dst_fmt);
   545         if (temp) {
   549         if (temp) {
   546             SDL_UpdateTexture(texture, NULL, temp->pixels, temp->pitch);
   550             SDL_UpdateTexture(texture, NULL, temp->pixels, temp->pitch);
   547             SDL_FreeSurface(temp);
   551             SDL_FreeSurface(temp);