mirror of
https://github.com/reactos/reactos.git
synced 2024-12-04 17:03:30 +08:00
[MCIAVI32] Media Player: Don't open empty files (#5063)
Opening an empty file in media player could cause a crash. CORE-18669
This commit is contained in:
parent
874d317a71
commit
ebc69d089f
@ -398,6 +398,13 @@ BOOL MCIAVI_GetInfo(WINE_MCIAVI* wma)
|
||||
|
||||
mmioAscend(wma->hFile, &mmckInfo, 0);
|
||||
}
|
||||
|
||||
/* Empty file */
|
||||
if (alb.numVideoFrames == 0) {
|
||||
WARN("NumVideoFrames: %u, Empty or possibly corrupt video file");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (alb.numVideoFrames != wma->dwPlayableVideoFrames) {
|
||||
WARN("AVI header says %d frames, we found %d video frames, reducing playable frames\n",
|
||||
wma->dwPlayableVideoFrames, alb.numVideoFrames);
|
||||
@ -613,6 +620,11 @@ double MCIAVI_PaintFrame(WINE_MCIAVI* wma, HDC hDC)
|
||||
|
||||
if (wma->dwCurrVideoFrame != wma->dwCachedFrame)
|
||||
{
|
||||
if (wma->dwCurrVideoFrame >= wma->dwPlayableVideoFrames) {
|
||||
ERR("Invalid frame requested. Current : %u Total Playable %u\n", wma->dwCurrVideoFrame, wma->dwPlayableVideoFrames);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!wma->lpVideoIndex[wma->dwCurrVideoFrame].dwOffset)
|
||||
return 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user