From 6a3142d2c1b946b0a88265d461c413284c43432e Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Tue, 21 Jun 2011 11:45:34 +0000 Subject: [PATCH] Fix to (#5051) - strchr in GraphicsOptions_GetAspectRatios() might return NULL for some strange reason --- code/q3_ui/ui_video.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/q3_ui/ui_video.c b/code/q3_ui/ui_video.c index e33d31cd..b1048de2 100644 --- a/code/q3_ui/ui_video.c +++ b/code/q3_ui/ui_video.c @@ -428,6 +428,10 @@ static void GraphicsOptions_GetAspectRatios( void ) // calculate resolution's aspect ratio x = strchr( resolutions[r], 'x' ) + 1; + + if(!x) + continue; + Q_strncpyz( str, resolutions[r], x-resolutions[r] ); w = atoi( str ); h = atoi( x );