Index: surface.c
===================================================================
--- surface.c	(revision 1036)
+++ surface.c	(working copy)
@@ -308,7 +308,7 @@
     if (!PyArg_ParseTuple (args, "(ii)|iOO", &width, &height, &flags, &depth,
                            &masks))
         return -1;
-
+   
     if (width < 0 || height < 0)
     {
         RAISE (PyExc_SDLError, "Invalid resolution for Surface");
@@ -416,7 +416,7 @@
         {
             pix = &default_format;
             pix->BitsPerPixel = 32;
-            pix->Amask = 0;
+            pix->Amask = (flags & SDL_SRCALPHA) ? 0xFF000000 : 0;
             pix->Rmask = 0xFF0000;
             pix->Gmask = 0xFF00;
             pix->Bmask = 0xFF;
@@ -427,6 +427,13 @@
         Bmask = pix->Bmask;
         Amask = pix->Amask;
     }
+
+    if (Amask == 0 && (flags & SDL_SRCALPHA))
+    {
+        RAISE (PyExc_SDLError, "The surface depth/format does not support per-pixel alpha");
+        return -1;
+    }
+    
     surface = SDL_CreateRGBSurface (flags, width, height, bpp, Rmask, Gmask,
                                     Bmask, Amask);
     if (!surface)
