mirror of
https://github.com/reactos/reactos.git
synced 2024-11-04 22:00:55 +00: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
1 changed files with 12 additions and 0 deletions
|
@ -398,6 +398,13 @@ BOOL MCIAVI_GetInfo(WINE_MCIAVI* wma)
|
||||||
|
|
||||||
mmioAscend(wma->hFile, &mmckInfo, 0);
|
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) {
|
if (alb.numVideoFrames != wma->dwPlayableVideoFrames) {
|
||||||
WARN("AVI header says %d frames, we found %d video frames, reducing playable frames\n",
|
WARN("AVI header says %d frames, we found %d video frames, reducing playable frames\n",
|
||||||
wma->dwPlayableVideoFrames, alb.numVideoFrames);
|
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->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)
|
if (!wma->lpVideoIndex[wma->dwCurrVideoFrame].dwOffset)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue