Commit b5c2172f59f42934b76e4ac607f2c7ef4f049bb4

Werner Lemberg 2022-01-07T06:53:44

[sfnt] Avoid 'runtime error: applying zero offset to null pointer'. * src/sfnt/ttsbit.c (tt_sbit_decoder_load_byte_aligned): Exit early if `line` is NULL.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/sfnt/ttsbit.c b/src/sfnt/ttsbit.c
index e9ba697..615e23d 100644
--- a/src/sfnt/ttsbit.c
+++ b/src/sfnt/ttsbit.c
@@ -730,6 +730,9 @@
     pitch      = bitmap->pitch;
     line       = bitmap->buffer;
 
+    if ( !line )
+      goto Exit;
+
     width  = decoder->metrics->width;
     height = decoder->metrics->height;