Snap for 10066519 from 9956f7e12ee2d44da29acd8b4d9af4da2ff4bbb6 to mainline-cellbroadcast-release

Change-Id: I2581cf598d09bd332fe7d9379de454ab691cbd91
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 883f1a8..46baf5f 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -2451,6 +2451,15 @@
 #endif
 
 
+    /* only use lower 31 bits together with sign bit */
+    if ( face_index > 0 )
+      face_index &= 0x7FFFFFFFL;
+    else
+    {
+      face_index &= 0x7FFFFFFFL;
+      face_index  = -face_index;
+    }
+
 #ifdef FT_DEBUG_LEVEL_TRACE
     FT_TRACE3(( "FT_Open_Face: " ));
     if ( face_index < 0 )
@@ -3323,6 +3332,9 @@
     if ( !face )
       return FT_THROW( Invalid_Face_Handle );
 
+    if ( !face->size )
+      return FT_THROW( Invalid_Size_Handle );
+
     if ( !req || req->width < 0 || req->height < 0 ||
          req->type >= FT_SIZE_REQUEST_TYPE_MAX )
       return FT_THROW( Invalid_Argument );