https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9b5d029c7a45402f46f93…
commit 9b5d029c7a45402f46f93265888f137ea0669d98
Author: Hervé Poussineau <hpoussin(a)reactos.org>
AuthorDate: Sun Jul 4 23:27:01 2021 +0200
Commit: Hervé Poussineau <hpoussin(a)reactos.org>
CommitDate: Mon Jul 5 23:44:35 2021 +0200
[FRAMEBUF] Early return if we got 0 available mode from video driver
This prevents allocating 0 bytes of memory a few lines later.
---
win32ss/drivers/displays/framebuf/screen.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/win32ss/drivers/displays/framebuf/screen.c
b/win32ss/drivers/displays/framebuf/screen.c
index b97a0274695..7ec7ecff138 100644
--- a/win32ss/drivers/displays/framebuf/screen.c
+++ b/win32ss/drivers/displays/framebuf/screen.c
@@ -51,6 +51,11 @@ GetAvailableModes(
return 0;
}
+ if (Modes.NumModes == 0)
+ {
+ return 0;
+ }
+
*ModeInfoSize = Modes.ModeInformationLength;
/*