Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add detection for Ogg skeleton metadata #678

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter
Filter file types
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.

Always

Just for now

Next
Add detection for Ogg skeleton metadata
  • Loading branch information
kcgen committed Nov 18, 2018
commit d60db7fb6af0807cdc18e24f0d4d53229b585d72
@@ -374,7 +374,8 @@ enum STBVorbisError
VORBIS_invalid_first_page,
VORBIS_bad_packet_type,
VORBIS_cant_find_last_page,
VORBIS_seek_failed
VORBIS_seek_failed,
VORBIS_ogg_skeleton_not_supported
};


@@ -3579,6 +3580,18 @@ static int start_decoder(vorb *f)
// check for expected packet length
if (f->segment_count != 1) return error(f, VORBIS_invalid_first_page);
if (f->segments[0] != 30) return error(f, VORBIS_invalid_first_page);
// check for the Ogg skeleton fishead identifying header to refine our error
if (f->segments[0] == 64 &&
getn(f, header, 6) &&
header[0] == 'f' &&
header[1] == 'i' &&
header[2] == 's' &&
header[3] == 'h' &&
header[4] == 'e' &&
header[5] == 'a' &&
get8(f) == 'd') return error(f, VORBIS_ogg_skeleton_not_supported);
This conversation was marked as resolved by kcgen

This comment has been minimized.

@Daniel-Cortez

Daniel-Cortez Nov 18, 2018

This check doesn't seem complete without the \0 character. Can you also take that character into account?

This comment has been minimized.

@kcgen

kcgen Nov 19, 2018
Author Contributor

Got it (see 2nd commit). Thanks for the check!

else
return error(f, VORBIS_invalid_first_page);
// read packet
// check packet header
if (get8(f) != VORBIS_packet_id) return error(f, VORBIS_invalid_first_page);
ProTip! Use n and p to navigate between commits in a pull request.