Skip to content

Commit

Permalink
Fix gapless calculation in frontend (#203)
Browse files Browse the repository at this point in the history
Right side is evaluated first. samples and decoded are unsigned ints
which underflow to a very large number.
  • Loading branch information
gavtroy authored Mar 5, 2024
1 parent f3a2fc3 commit 18ee294
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ static int decodeMP4file(char *mp4file, char *sndfile, char *adts_fn, int to_std
decoded += dur;

if (decoded > mp4config.samples)
dur += mp4config.samples - decoded;
dur -= decoded - mp4config.samples;

if (dur > framesize)
{
Expand Down

0 comments on commit 18ee294

Please sign in to comment.