mirror of
https://github.com/nothings/stb
synced 2024-12-16 04:42:42 +03:00
Fix return typo, disambiguate else, and check for the complete fishead identifier
This commit is contained in:
parent
604b9367ee
commit
d1dc3fe89c
@ -3579,7 +3579,7 @@ static int start_decoder(vorb *f)
|
|||||||
if (f->page_flag & PAGEFLAG_continued_packet) return error(f, VORBIS_invalid_first_page);
|
if (f->page_flag & PAGEFLAG_continued_packet) return error(f, VORBIS_invalid_first_page);
|
||||||
// check for expected packet length
|
// check for expected packet length
|
||||||
if (f->segment_count != 1) return error(f, VORBIS_invalid_first_page);
|
if (f->segment_count != 1) return error(f, VORBIS_invalid_first_page);
|
||||||
if (f->segments[0] != 30) return error(f, VORBIS_invalid_first_page);
|
if (f->segments[0] != 30) {
|
||||||
// check for the Ogg skeleton fishead identifying header to refine our error
|
// check for the Ogg skeleton fishead identifying header to refine our error
|
||||||
if (f->segments[0] == 64 &&
|
if (f->segments[0] == 64 &&
|
||||||
getn(f, header, 6) &&
|
getn(f, header, 6) &&
|
||||||
@ -3589,9 +3589,12 @@ static int start_decoder(vorb *f)
|
|||||||
header[3] == 'h' &&
|
header[3] == 'h' &&
|
||||||
header[4] == 'e' &&
|
header[4] == 'e' &&
|
||||||
header[5] == 'a' &&
|
header[5] == 'a' &&
|
||||||
get8(f) == 'd') return error(f, VORBIS_ogg_skeleton_not_supported);
|
get8(f) == 'd' &&
|
||||||
|
get8(f) == '\0') return error(f, VORBIS_ogg_skeleton_not_supported);
|
||||||
else
|
else
|
||||||
return error(f, VORBIS_invalid_first_page);
|
return error(f, VORBIS_invalid_first_page);
|
||||||
|
}
|
||||||
|
|
||||||
// read packet
|
// read packet
|
||||||
// check packet header
|
// check packet header
|
||||||
if (get8(f) != VORBIS_packet_id) return error(f, VORBIS_invalid_first_page);
|
if (get8(f) != VORBIS_packet_id) return error(f, VORBIS_invalid_first_page);
|
||||||
|
Loading…
Reference in New Issue
Block a user