From 96a5a3e402a2c7d4c8c44ca8d8b418e5c2204238 Mon Sep 17 00:00:00 2001 From: Bart van Strien Date: Sun, 11 Sep 2011 12:51:34 +0200 Subject: [PATCH] Catch not just the generic utf8 exception, but a few specific ones as well (bug #244) --- src/modules/graphics/opengl/Font.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/modules/graphics/opengl/Font.cpp b/src/modules/graphics/opengl/Font.cpp index a850c7c55..28b104401 100644 --- a/src/modules/graphics/opengl/Font.cpp +++ b/src/modules/graphics/opengl/Font.cpp @@ -174,6 +174,16 @@ namespace opengl dx += glyph->spacing; } } + catch (utf8::invalid_code_point e) + { + glPopMatrix(); + throw love::Exception(e.what()); + } + catch (utf8::invalid_utf8 e) + { + glPopMatrix(); + throw love::Exception(e.what()); + } catch (utf8::exception e) { glPopMatrix(); @@ -210,6 +220,16 @@ namespace opengl temp += static_cast(g->spacing * mSpacing); } } + catch (utf8::invalid_code_point e) + { + glPopMatrix(); + throw love::Exception(e.what()); + } + catch (utf8::invalid_utf8 e) + { + glPopMatrix(); + throw love::Exception(e.what()); + } catch (utf8::exception e) { throw love::Exception(e.what());