]> granicus.if.org Git - libass/commitdiff
directwrite: don't crash on unknown DWRITE_FONT_STRETCH
authorwm4 <wm4@nowhere>
Sat, 11 Jul 2015 21:00:26 +0000 (23:00 +0200)
committerwm4 <wm4@nowhere>
Sat, 11 Jul 2015 21:09:59 +0000 (23:09 +0200)
The existing code doesn't even handle all currently defined values
for it, and nothing says no new values are ever going to be added.

libass/ass_directwrite.c

index 483af50e833098208591058c349201bb58aa397c..0ce147827afaa5f1e7991783276096dfc8d49163 100644 (file)
@@ -475,7 +475,7 @@ static int map_width(enum DWRITE_FONT_STRETCH stretch)
     case DWRITE_FONT_STRETCH_EXTRA_EXPANDED:  return 150;
     case DWRITE_FONT_STRETCH_ULTRA_EXPANDED:  return 200;
     default:
-        assert(0);
+        return FONT_WIDTH_NORMAL;
     }
 }