Merge branch 'sean_image'
This commit is contained in:
commit
7c14c47e2f
12
stb_image.h
12
stb_image.h
@ -1,4 +1,4 @@
|
|||||||
/* stb_image - v2.27 - public domain image loader - http://nothings.org/stb
|
/* stb_image - v2.27x - public domain image loader - http://nothings.org/stb
|
||||||
no warranty implied; use at your own risk
|
no warranty implied; use at your own risk
|
||||||
|
|
||||||
Do this:
|
Do this:
|
||||||
@ -3424,15 +3424,19 @@ static int stbi__decode_jpeg_image(stbi__jpeg *j)
|
|||||||
j->marker = stbi__skip_jpeg_junk_at_end(j);
|
j->marker = stbi__skip_jpeg_junk_at_end(j);
|
||||||
// if we reach eof without hitting a marker, stbi__get_marker() below will fail and we'll eventually return 0
|
// if we reach eof without hitting a marker, stbi__get_marker() below will fail and we'll eventually return 0
|
||||||
}
|
}
|
||||||
|
m = stbi__get_marker(j);
|
||||||
|
if (STBI__RESTART(m))
|
||||||
|
m = stbi__get_marker(j);
|
||||||
} else if (stbi__DNL(m)) {
|
} else if (stbi__DNL(m)) {
|
||||||
int Ld = stbi__get16be(j->s);
|
int Ld = stbi__get16be(j->s);
|
||||||
stbi__uint32 NL = stbi__get16be(j->s);
|
stbi__uint32 NL = stbi__get16be(j->s);
|
||||||
if (Ld != 4) return stbi__err("bad DNL len", "Corrupt JPEG");
|
if (Ld != 4) return stbi__err("bad DNL len", "Corrupt JPEG");
|
||||||
if (NL != j->s->img_y) return stbi__err("bad DNL height", "Corrupt JPEG");
|
if (NL != j->s->img_y) return stbi__err("bad DNL height", "Corrupt JPEG");
|
||||||
} else {
|
|
||||||
if (!stbi__process_marker(j, m)) return 0;
|
|
||||||
}
|
|
||||||
m = stbi__get_marker(j);
|
m = stbi__get_marker(j);
|
||||||
|
} else {
|
||||||
|
if (!stbi__process_marker(j, m)) return 1;
|
||||||
|
m = stbi__get_marker(j);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (j->progressive)
|
if (j->progressive)
|
||||||
stbi__jpeg_finish(j);
|
stbi__jpeg_finish(j);
|
||||||
|
Loading…
Reference in New Issue
Block a user