sillsdev / SpeechAnalyzer

SIL Speech Analyzer is a Windows program for acoustic analysis of speech sounds.
https://software.sil.org/speech-analyzer/
7 stars 3 forks source link

bug: crash when resizing cancelled spectrogram window #55

Open kgorham opened 2 years ago

kgorham commented 2 years ago

To reproduce: 1) Open clip 'Lahu Shi 1-3.wav' 2) Select layout with waveform/spectrogram 3) Enable the formant track rendering via the toolbar. 4) Wait a couple seconds and cancel the rendering by pressing escape. 5) Grab the lower right corner of the spectrogram window and continually resize the window. After a while it will crash.

Code fails due to access violation.

Line: pPixel = (uint8)((pPowerLeft[y] nLeft + pPowerRight[y] * nRight + 8192) >> 14);

Call stack:

SA.exe!CPlotSpectrogram::OnDrawSpectrogram(CDC pDC, CRect rWnd, CRect rClip, CSaView pView, int bSmooth, int bAliased) Line 606 C++ SA.exe!CPlotSpectrogram::OnDraw2(CDC pDC, CRect rWnd, CRect rClip, CSaView pView) Line 1032 C++ SA.exe!CPlotSpectrogram::OnDraw(CDC pDC, CRect rWnd, CRect rClip, CSaView pView) Line 1130 C++ SA.exe!CPlotWnd::OnPaint() Line 2035 C++ [External Code] mfc140ud.dll![Frames below may be incorrect and/or missing, no symbols loaded for mfc140ud.dll] Unknown SA.exe!wWinMain(HINSTANCE__ hInstance, HINSTANCE__ hPrevInstance, wchar_t lpCmdLine, int nCmdShow) Line 26 C++