IMG_pcx.c
changeset 643 b920be2b3fc6
parent 642 7453e79c8cdb
child 646 e7e9786a1a34
     1.1 --- a/IMG_pcx.c	Mon Jun 10 13:07:58 2019 -0700
     1.2 +++ b/IMG_pcx.c	Mon Jun 10 13:12:46 2019 -0700
     1.3 @@ -160,7 +160,7 @@
     1.4          goto done;
     1.5  
     1.6      bpl = pcxh.NPlanes * pcxh.BytesPerLine;
     1.7 -    if ( bpl > surface->pitch ) {
     1.8 +    if ( bpl < 0 || bpl > surface->pitch ) {
     1.9          error = "bytes per line is too large (corrupt?)";
    1.10          goto done;
    1.11      }