Skip to content

Commit

Permalink
Fixed TALOS-2019-0821, reading invalid data from the file when bpl is -1
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jun 10, 2019
1 parent 782d29a commit 802a9ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion IMG_pcx.c
Expand Up @@ -160,7 +160,7 @@ SDL_Surface *IMG_LoadPCX_RW(SDL_RWops *src)
goto done;

bpl = pcxh.NPlanes * pcxh.BytesPerLine;
if ( bpl > surface->pitch ) {
if ( bpl < 0 || bpl > surface->pitch ) {
error = "bytes per line is too large (corrupt?)";
goto done;
}
Expand Down

0 comments on commit 802a9ec

Please sign in to comment.