@@ -72,7 +72,8 @@ video::ITexture *guiScalingResizeCached(video::IVideoDriver *driver,
72
72
video::ITexture *src, const core::rect<s32> &srcrect,
73
73
const core::rect<s32> &destrect)
74
74
{
75
-
75
+ if (src == NULL )
76
+ return src;
76
77
if (!g_settings->getBool (" gui_scaling_filter" ))
77
78
return src;
78
79
@@ -139,6 +140,8 @@ video::ITexture *guiScalingResizeCached(video::IVideoDriver *driver,
139
140
video::ITexture *guiScalingImageButton (video::IVideoDriver *driver,
140
141
video::ITexture *src, s32 width, s32 height)
141
142
{
143
+ if (src == NULL )
144
+ return src;
142
145
return guiScalingResizeCached (driver, src,
143
146
core::rect<s32>(0 , 0 , src->getSize ().Width , src->getSize ().Height ),
144
147
core::rect<s32>(0 , 0 , width, height));
@@ -154,6 +157,8 @@ void draw2DImageFilterScaled(video::IVideoDriver *driver, video::ITexture *txr,
154
157
{
155
158
// Attempt to pre-scale image in software in high quality.
156
159
video::ITexture *scaled = guiScalingResizeCached (driver, txr, srcrect, destrect);
160
+ if (scaled == NULL )
161
+ return ;
157
162
158
163
// Correct source rect based on scaled image.
159
164
const core::rect<s32> mysrcrect = (scaled != txr)
0 commit comments