소스 검색

stbi__skip should return immediately if skipping zero bytes.

Otherwise we might waste time or throw away state in the i/o callbacks.
Ryan C. Gordon 5 년 전
부모
커밋
89f3f35c9f
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      stb_image.h

+ 1 - 0
stb_image.h

@@ -1564,6 +1564,7 @@ stbi_inline static int stbi__at_eof(stbi__context *s)
 #else
 static void stbi__skip(stbi__context *s, int n)
 {
+   if (n == 0) return;  // already there!
    if (n < 0) {
       s->img_buffer = s->img_buffer_end;
       return;