mciwave: Correctly handle error return status from mmioRead.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Eric Pouech 2022-03-30 14:57:38 +02:00 committed by Alexandre Julliard
parent 684944f061
commit 90ecf27d09
1 changed files with 1 additions and 1 deletions

View File

@ -291,7 +291,7 @@ static DWORD WAVE_mciReadFmt(WINE_MCIWAVE* wmw, const MMCKINFO* pckMainRIFF)
if (!pwfx) return MCIERR_OUT_OF_MEMORY;
r = mmioRead(wmw->hFile, (HPSTR)pwfx, mmckInfo.cksize);
if (r < sizeof(PCMWAVEFORMAT)) {
if (r < 0 || r < sizeof(PCMWAVEFORMAT)) {
HeapFree(GetProcessHeap(), 0, pwfx);
return MCIERR_INVALID_FILE;
}