File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1457,6 +1457,7 @@ surf_convert(pgSurfaceObject *self, PyObject *args)
14571457 /* will be updated later, initialize to make static analyzer happy
14581458 */
14591459 int bpp = 0 ;
1460+ SDL_Palette * palette = SDL_AllocPalette (default_palette_size );
14601461 SDL_PixelFormat format ;
14611462
14621463 memcpy (& format , surf -> format , sizeof (format ));
@@ -1566,15 +1567,14 @@ surf_convert(pgSurfaceObject *self, PyObject *args)
15661567 /* Give the surface something other than an all white
15671568 * palette.
15681569 */
1569- SDL_Palette * palette =
1570- SDL_AllocPalette (default_palette_size );
15711570 SDL_SetPaletteColors (palette , default_palette_colors , 0 ,
15721571 default_palette_size );
15731572 format .palette = palette ;
15741573 }
15751574 }
15761575 newsurf = SDL_ConvertSurface (surf , & format , 0 );
15771576 SDL_SetSurfaceBlendMode (newsurf , SDL_BLENDMODE_NONE );
1577+ SDL_FreePalette (palette );
15781578 }
15791579 }
15801580 else {
You can’t perform that action at this time.
0 commit comments