# sdl12-compat: fix SDL12COMPAT\_MAX\_VIDMODE,

**URL:** <https://discourse.libsdl.org/t/sdl12-compat-fix-sdl12compat-max-vidmode/39554>\
**Category:** SDL Commits\
**Created:** [October 25, 2022, 1:20pm UTC](https://discourse.libsdl.org/t/sdl12-compat-fix-sdl12compat-max-vidmode/39554 "2022-10-25T13:20:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [October 25, 2022, 1:20pm UTC](https://discourse.libsdl.org/t/sdl12-compat-fix-sdl12compat-max-vidmode/39554/1 "2022-10-25T13:20:02Z")

</div>

> <https://github.com/libsdl-org/sdl12-compat/commit/77892a1ef5260fe78e593c8337dbe98874ff336c>
>
> .. was broken by commit 7be4b3c99a436e360a43aefc929087c46cdadee9

```diff
From 77892a1ef5260fe78e593c8337dbe98874ff336c Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Tue, 25 Oct 2022 15:56:50 +0300
Subject: [PATCH] fix SDL12COMPAT_MAX_VIDMODE,

.. was broken by commit 7be4b3c99a436e360a43aefc929087c46cdadee9
---
 src/SDL12_compat.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c
index 64ba56f90..1123cc91f 100644
--- a/src/SDL12_compat.c
+++ b/src/SDL12_compat.c
@@ -2119,6 +2119,8 @@ Init12VidModes(void)
         SDL_sscanf(maxmodestr, "%ux%u", &w, &h);
         if (w > 0xFFFF) w = 0xFFFF;
         if (h > 0xFFFF) h = 0xFFFF;
+ maxw = w;
+ maxh = h;
     }
 
     for (i = 0; i < total; ++i) {

```
