Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Commit

Permalink
AudioSwitcher: fixed overflow (could cause stuttering and crash)
Browse files Browse the repository at this point in the history
  • Loading branch information
v0lt committed Dec 1, 2012
1 parent 2fcb2bb commit eba3aa1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/filters/switcher/AudioSwitcher/AudioSwitcher.cpp
Expand Up @@ -496,7 +496,7 @@ CMediaType CAudioSwitcherFilter::CreateNewOutputMediaType(CMediaType mt, long& c

int bps = wfe->wBitsPerSample >> 3;
int len = cbBuffer / (bps * wfe->nChannels);
int lenout = len * wfeout->nSamplesPerSec / wfe->nSamplesPerSec;
int lenout = (UINT64)len * wfeout->nSamplesPerSec / wfe->nSamplesPerSec;
cbBuffer = lenout * bps * wfeout->nChannels;

// mt.lSampleSize = (ULONG)max(mt.lSampleSize, wfe->nAvgBytesPerSec * rtLen / 10000000i64);
Expand Down

0 comments on commit eba3aa1

Please sign in to comment.