diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 973c6c502a..fd424b1035 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -818,7 +818,7 @@ bool NativeInitGraphics(GraphicsContext *graphicsContext) { size_t atlas_data_size = 0; if (!g_ui_atlas.IsMetadataLoaded()) { const uint8_t *atlas_data = VFSReadFile("ui_atlas.meta", &atlas_data_size); - bool load_success = g_ui_atlas.Load(atlas_data, atlas_data_size); + bool load_success = atlas_data != nullptr && g_ui_atlas.Load(atlas_data, atlas_data_size); _assert_msg_(G3D, load_success, "Failed to load ui_atlas.meta"); delete[] atlas_data; } diff --git a/ext/native/gfx_es2/draw_buffer.cpp b/ext/native/gfx_es2/draw_buffer.cpp index dbe024fe24..ee6a9e008c 100644 --- a/ext/native/gfx_es2/draw_buffer.cpp +++ b/ext/native/gfx_es2/draw_buffer.cpp @@ -250,6 +250,9 @@ inline void rot(float *v, float angle, float xc, float yc) { void DrawBuffer::DrawImageRotated(ImageID atlas_image, float x, float y, float scale, float angle, Color color, bool mirror_h) { const AtlasImage *image = atlas->getImage(atlas_image); + if (!image) + return; + float w = (float)image->w * scale; float h = (float)image->h * scale; float x1 = x - w / 2;