Procházet zdrojové kódy

stb_image: Erorr in BMP should error, not assert.

There was both the assert and the error check; should just be
the error check.

Fixes issue #881 (or rather, part of it).
Fabian Giesen před 4 roky
rodič
revize
4d3b93f589
1 změnil soubory, kde provedl 0 přidání a 1 odebrání
  1. 0 1
      stb_image.h

+ 0 - 1
stb_image.h

@@ -5411,7 +5411,6 @@ static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req
          psize = (info.offset - info.extra_read - info.hsz) >> 2;
          psize = (info.offset - info.extra_read - info.hsz) >> 2;
    }
    }
    if (psize == 0) {
    if (psize == 0) {
-      STBI_ASSERT(info.offset == s->callback_already_read + (int) (s->img_buffer - s->img_buffer_original));
       if (info.offset != s->callback_already_read + (s->img_buffer - s->img_buffer_original)) {
       if (info.offset != s->callback_already_read + (s->img_buffer - s->img_buffer_original)) {
         return stbi__errpuc("bad offset", "Corrupt BMP");
         return stbi__errpuc("bad offset", "Corrupt BMP");
       }
       }