mciwave: Prevent division by zero when processing non-PCM codec.

This commit is contained in:
Alex Villacís Lasso 2007-06-25 12:42:47 -05:00 committed by Alexandre Julliard
parent 417ae04ed9
commit 0b9cab02c4
1 changed files with 1 additions and 1 deletions

View File

@ -204,7 +204,7 @@ static DWORD WAVE_ConvertByteToTimeFormat(WINE_MCIWAVE* wmw, DWORD val, LPDWORD
ret = val;
break;
case MCI_FORMAT_SAMPLES: /* FIXME: is this correct ? */
ret = (val * 8) / wmw->lpWaveFormat->wBitsPerSample;
ret = (val * 8) / (wmw->lpWaveFormat->wBitsPerSample ? wmw->lpWaveFormat->wBitsPerSample : 1);
break;
default:
WARN("Bad time format %u!\n", wmw->dwMciTimeFormat);