Skip to content

Commit 802a9ec

Browse files
committed
Fixed TALOS-2019-0821, reading invalid data from the file when bpl is -1
1 parent 782d29a commit 802a9ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

IMG_pcx.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ SDL_Surface *IMG_LoadPCX_RW(SDL_RWops *src)
160160
goto done;
161161

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

0 commit comments

Comments
 (0)