Skip to content

Commit

Permalink
SDL_sound_vorbis.c: error-out if the vorbis file has no samples.
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Dec 11, 2023
1 parent 9ebcb8b commit d372bfe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/SDL_sound_vorbis.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ static int VORBIS_open(Sound_Sample *sample, const char *ext)
sample->actual.rate = stb->sample_rate;
num_frames = stb_vorbis_stream_length_in_samples(stb);
if (!num_frames)
internal->total_time = -1;
{
BAIL_MACRO("VORBIS: No samples in ogg/vorbis stream.", 0);
}
else
{
const unsigned int rate = stb->sample_rate;
Expand Down

2 comments on commit d372bfe

@sezero
Copy link
Collaborator Author

@sezero sezero commented on d372bfe Dec 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@icculus: I believe this is the right thing to do, but please revise if necessary.

@icculus
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is right.

Please sign in to comment.