summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2010-06-22 12:14:35 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2010-06-22 12:14:35 +0200
commitf0dcb906fe56b5dc06aa305b6cfc821d5dd25a28 (patch)
tree6ce987e8638abf995a38003d7de80431d28af354
parent16d8ab747c65024102c0e1415584ace91cc78613 (diff)
Fix crash with certain fonts
Regressed with a1714c84f245beb182a2221a1832b041788af200 and ab9a897b688e991a8405cf938dea9d6a2f1ac072, which removed the handling for value records that specify an device advance tables but do not actually have an offset for it. Previously HB_OPEN_Get_Device handled this through the HB_Device being allocated as structure and zero initialized. Now this case is represented by a null pointer HB_Device, which we must handle. Reviewed-by: Andreas Kling <andreas.kling@nokia.com>
-rw-r--r--src/harfbuzz-open.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/harfbuzz-open.c b/src/harfbuzz-open.c
index 15cd2c1..f12f5b7 100644
--- a/src/harfbuzz-open.c
+++ b/src/harfbuzz-open.c
@@ -1403,12 +1403,11 @@ _HB_OPEN_Get_Device( HB_Device* d,
HB_UShort size,
HB_Short* value )
{
- HB_UShort byte, bits, mask, f, s;
+ HB_UShort byte, bits, mask, s;
- f = d->DeltaFormat;
-
- if ( d->DeltaValue && size >= d->StartSize && size <= d->EndSize )
+ if ( d && d->DeltaValue && size >= d->StartSize && size <= d->EndSize )
{
+ HB_UShort f = d->DeltaFormat;
s = size - d->StartSize;
byte = d->DeltaValue[s >> ( 4 - f )];
bits = byte >> ( 16 - ( ( s % ( 1 << ( 4 - f ) ) + 1 ) << f ) );