File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -1774,6 +1774,8 @@ bool MIX_SetTrackPlaybackPosition(MIX_Track *track, Sint64 frames)
1774
1774
{
1775
1775
if (!CheckTrackParam (track )) {
1776
1776
return false;
1777
+ } else if (frames < 0 ) {
1778
+ return SDL_InvalidParamError ("frames" );
1777
1779
}
1778
1780
1779
1781
bool retval = true;
@@ -1864,6 +1866,8 @@ Sint64 MIX_MSToFrames(int sample_rate, Sint64 ms)
1864
1866
{
1865
1867
if (sample_rate <= 0 ) {
1866
1868
return 0 ;
1869
+ } else if (ms < 0 ) {
1870
+ return 0 ;
1867
1871
}
1868
1872
return (Sint64 ) ((((double ) ms ) / 1000.0 ) * ((double ) sample_rate ));
1869
1873
}
@@ -1872,6 +1876,8 @@ Sint64 MIX_FramesToMS(int sample_rate, Sint64 frames)
1872
1876
{
1873
1877
if (sample_rate <= 0 ) {
1874
1878
return 0 ;
1879
+ } else if (frames < 0 ) {
1880
+ return 0 ;
1875
1881
}
1876
1882
return (Sint64 ) ((((double ) frames ) / ((double ) sample_rate )) * 1000.0 );
1877
1883
}
You can’t perform that action at this time.
0 commit comments