فهرست منبع

Avoid asserts because could crash some decompressions https://github.com/raysan5/raygui/issues/364

Ray 1 سال پیش
والد
کامیت
cb2572fe07
1فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 3 3
      src/external/sinfl.h

+ 3 - 3
src/external/sinfl.h

@@ -231,13 +231,13 @@ sinfl_refill(struct sinfl *s) {
 }
 static int
 sinfl_peek(struct sinfl *s, int cnt) {
-  assert(cnt >= 0 && cnt <= 56);
-  assert(cnt <= s->bitcnt);
+  //assert(cnt >= 0 && cnt <= 56);          // @raysan5: commented to avoid crash on decompression
+  //assert(cnt <= s->bitcnt);
   return s->bitbuf & ((1ull << cnt) - 1);
 }
 static void
 sinfl_eat(struct sinfl *s, int cnt) {
-  assert(cnt <= s->bitcnt);
+  //assert(cnt <= s->bitcnt);               // @raysan5: commented
   s->bitbuf >>= cnt;
   s->bitcnt -= cnt;
 }