We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 62cd8cd commit f676999Copy full SHA for f676999
1 file changed
IMG_pcx.c
@@ -147,7 +147,7 @@ SDL_Surface *IMG_LoadPCX_RW(SDL_RWops *src)
147
if (bpl > surface->pitch) {
148
error = "bytes per line is too large (corrupt?)";
149
}
150
- buf = (Uint8 *)SDL_malloc(bpl);
+ buf = (Uint8 *)SDL_calloc(SDL_max(bpl, surface->pitch), 1);
151
row = (Uint8 *)surface->pixels;
152
for ( y=0; y<surface->h; ++y ) {
153
/* decode a scan line to a temporary buffer first */
0 commit comments