src/video/SDL_bmp.c
changeset 7913 44dc7926f62d
parent 7720 f9a649383362
child 7921 74dd62231c5a
equal deleted inserted replaced
7912:10eff60470b3 7913:44dc7926f62d
   148         biHeight = (Uint32) SDL_ReadLE16(src);
   148         biHeight = (Uint32) SDL_ReadLE16(src);
   149         /* biPlanes = */ SDL_ReadLE16(src);
   149         /* biPlanes = */ SDL_ReadLE16(src);
   150         biBitCount = SDL_ReadLE16(src);
   150         biBitCount = SDL_ReadLE16(src);
   151         biCompression = BI_RGB;
   151         biCompression = BI_RGB;
   152     } else {
   152     } else {
       
   153         const int headerSize = 40;
       
   154 
   153         biWidth = SDL_ReadLE32(src);
   155         biWidth = SDL_ReadLE32(src);
   154         biHeight = SDL_ReadLE32(src);
   156         biHeight = SDL_ReadLE32(src);
   155         /* biPlanes = */ SDL_ReadLE16(src);
   157         /* biPlanes = */ SDL_ReadLE16(src);
   156         biBitCount = SDL_ReadLE16(src);
   158         biBitCount = SDL_ReadLE16(src);
   157         biCompression = SDL_ReadLE32(src);
   159         biCompression = SDL_ReadLE32(src);
   158         /* biSizeImage = */ SDL_ReadLE32(src);
   160         /* biSizeImage = */ SDL_ReadLE32(src);
   159         /* biXPelsPerMeter = */ SDL_ReadLE32(src);
   161         /* biXPelsPerMeter = */ SDL_ReadLE32(src);
   160         /* biYPelsPerMeter = */ SDL_ReadLE32(src);
   162         /* biYPelsPerMeter = */ SDL_ReadLE32(src);
   161         biClrUsed = SDL_ReadLE32(src);
   163         biClrUsed = SDL_ReadLE32(src);
   162         /* biClrImportant = */ SDL_ReadLE32(src);
   164         /* biClrImportant = */ SDL_ReadLE32(src);
       
   165 
       
   166         if (biSize > headerSize) {
       
   167             SDL_RWseek(src, (biSize - headerSize), RW_SEEK_CUR);
       
   168         }
   163     }
   169     }
   164     if (biHeight < 0) {
   170     if (biHeight < 0) {
   165         topDown = SDL_TRUE;
   171         topDown = SDL_TRUE;
   166         biHeight = -biHeight;
   172         biHeight = -biHeight;
   167     } else {
   173     } else {