Skip to content

Commit

Permalink
fix edit list duration typo for AC3, EC3 and AC4.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yun committed Jul 18, 2024
1 parent 874c264 commit 1c21023
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/C++/Apps/Mp4Mux/Mp4Mux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ AddAc3Track(AP4_Movie& movie,
if (!movie.GetTimeScale()) {
duration = sample_count * 1536;
} else {
duration = AP4_ConvertTime(1000*sample_table->GetSampleCount(), sample_rate, movie.GetTimeScale());
duration = AP4_ConvertTime(1536*sample_table->GetSampleCount(), sample_rate, movie.GetTimeScale());
}
AP4_ElstEntry new_elst_entry = AP4_ElstEntry(duration, 0, 1);
new_elst->AddEntry(new_elst_entry);
Expand Down Expand Up @@ -814,7 +814,7 @@ AddEac3Track(AP4_Movie& movie,
if (!movie.GetTimeScale()) {
duration = sample_count * 1536;
} else {
duration = AP4_ConvertTime(1000*sample_table->GetSampleCount(), sample_rate, movie.GetTimeScale());
duration = AP4_ConvertTime(1536*sample_table->GetSampleCount(), sample_rate, movie.GetTimeScale());
}
AP4_ElstEntry new_elst_entry = AP4_ElstEntry(duration, 0, 1);
new_elst->AddEntry(new_elst_entry);
Expand Down Expand Up @@ -962,7 +962,7 @@ AddAc4Track(AP4_Movie& movie,
if (!movie.GetTimeScale()) {
duration = AP4_UI64(sample_count) * sample_duration;
} else {
duration = AP4_ConvertTime(1000*sample_table->GetSampleCount(), media_time_scale, movie.GetTimeScale());
duration = AP4_ConvertTime(sample_duration*sample_table->GetSampleCount(), media_time_scale, movie.GetTimeScale());

Check failure

Code scanning / CodeQL

Multiplication result converted to larger type High

Multiplication result may overflow 'unsigned int' before it is converted to 'AP4_UI64'.
}
AP4_ElstEntry new_elst_entry = AP4_ElstEntry(duration, 0, 1);
new_elst->AddEntry(new_elst_entry);
Expand Down

0 comments on commit 1c21023

Please sign in to comment.