We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1470

Summary: broken image load with -std=c++0x option
Product: SDL_image Reporter: Mikhail <selivanov.mike>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: unspecified   
Hardware: x86   
OS: Linux   
Attachments: bad looking image

Description Mikhail 2012-04-10 13:25:09 UTC
Created attachment 843 [details]
bad looking image

I see only part of loaded image. It's happening when I compiling with -std=c++0x option. 

CODE:

#include "SDL/SDL.h"
#include "SDL/SDL_image.h"

int main(int argc, char* args[])
{

  SDL_Surface* hello = NULL;
  SDL_Surface* screen = NULL;

  SDL_Init(SDL_INIT_EVERYTHING);

  screen = SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE);

  hello = IMG_Load("alien.png");                                                                                                                                         
  SDL_BlitSurface(hello, NULL, screen, NULL);
  SDL_Flip(screen);
  SDL_Delay(2000);
  SDL_FreeSurface(hello);
  SDL_Quit();

  return 0;
}


COMPILER:

mike@mike-laptop:~/work/invdrs$ g++ --version
g++ (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

SDL:

Source: libsdl1.2
Version: 1.2.14-6.1ubuntu4
Comment 1 Mikhail 2012-04-10 13:29:36 UTC
Sorry, it's a bug in my code, I set 24 bit depth in SDL_SetVideoMode and now it's all right.