../3rdparty/harfbuzz/src/harfbuzz-gpos.c

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2struct GPOS_Instance_ -
3{ -
4 HB_GPOSHeader* gpos; -
5 HB_Font font; -
6 HB_Bool dvi; -
7 HB_UShort load_flags; -
8 HB_Bool r2l; -
9 -
10 HB_UShort last; -
11 -
12 HB_Fixed anchor_x; -
13 HB_Fixed anchor_y; -
14}; -
15 -
16typedef struct GPOS_Instance_ GPOS_Instance; -
17 -
18 -
19static HB_Error GPOS_Do_Glyph_Lookup( GPOS_Instance* gpi, -
20 HB_UShort lookup_index, -
21 HB_Buffer buffer, -
22 HB_UShort context_length, -
23 int nesting_level ); -
24HB_Error HB_Load_GPOS_Table( HB_Stream stream, -
25 HB_GPOSHeader** retptr, -
26 HB_GDEFHeader* gdef, -
27 HB_Stream gdefStream ) -
28{ -
29 HB_UInt cur_offset, new_offset, base_offset; -
30 -
31 HB_GPOSHeader* gpos; -
32 -
33 HB_Error error = HB_Err_Ok; -
34 -
35 -
36 if ( !retptr )
partially evaluated: !retptr
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
37 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
38 -
39 if ( (0) )
partially evaluated: (0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
40 return error;
never executed: return error;
0
41 -
42 base_offset = _hb_stream_pos( stream ); -
43 -
44 if ( ( (gpos) = _hb_alloc( sizeof( *gpos ), &error ), error != 0 ) )
partially evaluated: ( (gpos) = _hb_alloc( sizeof( *gpos ), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
45 return error;
never executed: return error;
0
46 -
47 -
48 -
49 -
50 -
51 -
52 -
53 if ( ( (error = (_hb_stream_seek( stream, base_offset + 4L ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, base_offset + 4L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
54 ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
55 goto Fail4;
never executed: goto Fail4;
0
56 -
57 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
58 -
59 _hb_stream_frame_exit( stream ); -
60 -
61 cur_offset = _hb_stream_pos( stream ); -
62 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
63 ( error = _HB_OPEN_Load_ScriptList( &gpos->ScriptList, 0-139
64 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_ScriptList( &gpos->ScriptList, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
65 goto Fail4;
never executed: goto Fail4;
0
66 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
67 -
68 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
69 goto Fail3;
never executed: goto Fail3;
0
70 -
71 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
72 -
73 _hb_stream_frame_exit( stream ); -
74 -
75 cur_offset = _hb_stream_pos( stream ); -
76 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
77 ( error = _HB_OPEN_Load_FeatureList( &gpos->FeatureList, 0-139
78 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_FeatureList( &gpos->FeatureList, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
79 goto Fail3;
never executed: goto Fail3;
0
80 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
81 -
82 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
83 goto Fail2;
never executed: goto Fail2;
0
84 -
85 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
86 -
87 _hb_stream_frame_exit( stream ); -
88 -
89 cur_offset = _hb_stream_pos( stream ); -
90 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
91 ( error = _HB_OPEN_Load_LookupList( &gpos->LookupList, 0-139
92 stream, HB_Type_GPOS ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_LookupList( &gpos->LookupList, stream, HB_Type_GPOS ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
93 goto Fail2;
never executed: goto Fail2;
0
94 -
95 gpos->gdef = gdef; -
96 -
97 if ( ( error = _HB_GDEF_LoadMarkAttachClassDef_From_LookupFlags( gdef, gdefStream, 0-139
98 gpos->LookupList.Lookup, 0-139
99 gpos->LookupList.LookupCount ) ) )
partially evaluated: ( error = _HB_GDEF_LoadMarkAttachClassDef_From_LookupFlags( gdef, gdefStream, gpos->LookupList.Lookup, gpos->LookupList.LookupCount ) )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
100 goto Fail1;
never executed: goto Fail1;
0
101 -
102 *retptr = gpos; -
103 -
104 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:139
139
105 -
106Fail1: -
107 _HB_OPEN_Free_LookupList( &gpos->LookupList, HB_Type_GPOS ); -
108 -
109Fail2:
code before this statement never executed: Fail2:
0
110 _HB_OPEN_Free_FeatureList( &gpos->FeatureList ); -
111 -
112Fail3:
code before this statement never executed: Fail3:
0
113 _HB_OPEN_Free_ScriptList( &gpos->ScriptList ); -
114 -
115Fail4:
code before this statement never executed: Fail4:
0
116 do { if ( (gpos) ) { _hb_free( gpos ); gpos = ((void *)0); } } while (0);
never executed: }
never evaluated: (gpos)
never executed: }
never evaluated: 0
0
117 -
118 return error;
never executed: return error;
0
119} -
120 -
121 -
122HB_Error HB_Done_GPOS_Table( HB_GPOSHeader* gpos ) -
123{ -
124 _HB_OPEN_Free_LookupList( &gpos->LookupList, HB_Type_GPOS ); -
125 _HB_OPEN_Free_FeatureList( &gpos->FeatureList ); -
126 _HB_OPEN_Free_ScriptList( &gpos->ScriptList ); -
127 -
128 do { if ( (gpos) ) { _hb_free( gpos ); gpos = ((void *)0); } } while (0);
partially evaluated: (gpos)
TRUEFALSE
yes
Evaluation Count:132
no
Evaluation Count:0
executed: }
Execution Count:132
executed: }
Execution Count:132
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:132
0-132
129 -
130 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:132
132
131} -
132 -
133static HB_UInt Calculate_Class2RecordSize(HB_UShort format1, HB_UShort format2) -
134{ -
135 -
136 return (format1 & 0x01) + (format2 & 0x01) 867382
137 + ((format1 & 0x02) >> 1) + ((format2 & 0x02) >> 1) 867382
138 + ((format1 & 0x04) >> 2) + ((format2 & 0x04) >> 2) 867382
139 + ((format1 & 0x08) >> 3) + ((format2 & 0x08) >> 3) 867382
140 + ((format1 & 0x10) >> 4) + ((format2 & 0x10) >> 4) 867382
141 + ((format1 & 0x20) >> 5) + ((format2 & 0x20) >> 5) 867382
142 + ((format1 & 0x40) >> 6) + ((format2 & 0x40) >> 6) 867382
143 + ((format1 & 0x80) >> 7) + ((format2 & 0x80) >> 7);
executed: return (format1 & 0x01) + (format2 & 0x01) + ((format1 & 0x02) >> 1) + ((format2 & 0x02) >> 1) + ((format1 & 0x04) >> 2) + ((format2 & 0x04) >> 2) + ((format1 & 0x08) >> 3) + ((format2 & 0x08) >> 3) + ((format1 & 0x10) >> 4) + ((format2 & 0x10) >> 4) + ((format1 & 0x20) >> 5) + ((format2 & 0x20) >> 5) + ((format1 & 0x40) >> 6) + ((format2 & 0x40) >> 6) + ((format1 & 0x80) >> 7) + ((format2 & 0x80) >> 7);
Execution Count:867382
867382
144} -
145static HB_Error Get_FlexibleValueRecord( GPOS_Instance* gpi, -
146 HB_Short* vr, -
147 HB_UShort format, -
148 HB_Position gd ) -
149{ -
150 HB_Error error = HB_Err_Ok; -
151 -
152 HB_16Dot16 x_scale, y_scale; -
153 -
154 if ( !format )
evaluated: !format
TRUEFALSE
yes
Evaluation Count:433444
yes
Evaluation Count:433444
433444
155 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:433444
433444
156 -
157 x_scale = gpi->font->x_scale; -
158 y_scale = gpi->font->y_scale; -
159 -
160 -
161 -
162 if ( format & 0x0001 ) {
partially evaluated: format & 0x0001
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:433444
0-433444
163 gd->x_pos += *vr * x_scale / 0x10000; -
164 vr++; -
165 }
never executed: }
0
166 if ( format & 0x0002 ) {
partially evaluated: format & 0x0002
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:433444
0-433444
167 gd->y_pos += *vr * y_scale / 0x10000; -
168 vr++; -
169 }
never executed: }
0
170 if ( format & 0x0004 ) {
partially evaluated: format & 0x0004
TRUEFALSE
yes
Evaluation Count:433444
no
Evaluation Count:0
0-433444
171 gd->x_advance += *vr * x_scale / 0x10000; -
172 vr++; -
173 }
executed: }
Execution Count:433444
433444
174 if ( format & 0x0008 ) {
partially evaluated: format & 0x0008
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:433444
0-433444
175 gd->y_advance += *vr * y_scale / 0x10000; -
176 vr++; -
177 }
never executed: }
0
178 -
179 return error;
executed: return error;
Execution Count:433444
433444
180} -
181 -
182 -
183 -
184 -
185 -
186static HB_Error Load_ValueRecord( HB_ValueRecord* vr, -
187 HB_UShort format, -
188 HB_UInt base_offset, -
189 HB_Stream stream ) -
190{ -
191 HB_Error error; -
192 -
193 HB_UInt cur_offset, new_offset; -
194 -
195 -
196 if ( format & 0x0001 )
evaluated: format & 0x0001
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:12
2-12
197 { -
198 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
199 return error;
never executed: return error;
0
200 -
201 vr->XPlacement = (stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )); -
202 -
203 _hb_stream_frame_exit( stream ); -
204 }
executed: }
Execution Count:2
2
205 else -
206 vr->XPlacement = 0;
executed: vr->XPlacement = 0;
Execution Count:12
12
207 -
208 if ( format & 0x0002 )
partially evaluated: format & 0x0002
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:14
0-14
209 { -
210 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
211 return error;
never executed: return error;
0
212 -
213 vr->YPlacement = (stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )); -
214 -
215 _hb_stream_frame_exit( stream ); -
216 }
never executed: }
0
217 else -
218 vr->YPlacement = 0;
executed: vr->YPlacement = 0;
Execution Count:14
14
219 -
220 if ( format & 0x0004 )
evaluated: format & 0x0004
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:2
2-12
221 { -
222 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12
0-12
223 return error;
never executed: return error;
0
224 -
225 vr->XAdvance = (stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )); -
226 -
227 _hb_stream_frame_exit( stream ); -
228 }
executed: }
Execution Count:12
12
229 else -
230 vr->XAdvance = 0;
executed: vr->XAdvance = 0;
Execution Count:2
2
231 -
232 if ( format & 0x0008 )
partially evaluated: format & 0x0008
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:14
0-14
233 { -
234 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
235 return error;
never executed: return error;
0
236 -
237 vr->YAdvance = (stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )); -
238 -
239 _hb_stream_frame_exit( stream ); -
240 }
never executed: }
0
241 else -
242 vr->YAdvance = 0;
executed: vr->YAdvance = 0;
Execution Count:14
14
243 -
244 if ( format & 0x00F0 )
partially evaluated: format & 0x00F0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:14
0-14
245 { -
246 if ( ( (vr->DeviceTables) = _hb_alloc( (4)*sizeof(HB_Device), &error ), error != 0 ) )
never evaluated: ( (vr->DeviceTables) = _hb_alloc( (4)*sizeof(HB_Device), &error ), error != 0 )
0
247 return error;
never executed: return error;
0
248 vr->DeviceTables[2] = 0; -
249 vr->DeviceTables[3] = 0; -
250 vr->DeviceTables[0] = 0; -
251 vr->DeviceTables[1] = 0; -
252 }
never executed: }
0
253 else -
254 { -
255 vr->DeviceTables = 0; -
256 }
executed: }
Execution Count:14
14
257 -
258 if ( format & 0x0010 )
partially evaluated: format & 0x0010
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:14
0-14
259 { -
260 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
261 goto Fail4;
never executed: goto Fail4;
0
262 -
263 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
264 -
265 _hb_stream_frame_exit( stream ); -
266 -
267 if ( new_offset )
never evaluated: new_offset
0
268 { -
269 new_offset += base_offset; -
270 -
271 cur_offset = _hb_stream_pos( stream ); -
272 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
273 ( error = _HB_OPEN_Load_Device( &vr->DeviceTables[0], 0
274 stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Device( &vr->DeviceTables[0], stream ) ) != HB_Err_Ok
0
275 goto Fail4;
never executed: goto Fail4;
0
276 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
277 }
never executed: }
0
278 }
never executed: }
0
279 -
280 if ( format & 0x0020 )
partially evaluated: format & 0x0020
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:14
0-14
281 { -
282 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
283 goto Fail3;
never executed: goto Fail3;
0
284 -
285 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
286 -
287 _hb_stream_frame_exit( stream ); -
288 -
289 if ( new_offset )
never evaluated: new_offset
0
290 { -
291 new_offset += base_offset; -
292 -
293 cur_offset = _hb_stream_pos( stream ); -
294 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
295 ( error = _HB_OPEN_Load_Device( &vr->DeviceTables[1], 0
296 stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Device( &vr->DeviceTables[1], stream ) ) != HB_Err_Ok
0
297 goto Fail3;
never executed: goto Fail3;
0
298 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
299 }
never executed: }
0
300 }
never executed: }
0
301 -
302 if ( format & 0x0040 )
partially evaluated: format & 0x0040
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:14
0-14
303 { -
304 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
305 goto Fail2;
never executed: goto Fail2;
0
306 -
307 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
308 -
309 _hb_stream_frame_exit( stream ); -
310 -
311 if ( new_offset )
never evaluated: new_offset
0
312 { -
313 new_offset += base_offset; -
314 -
315 cur_offset = _hb_stream_pos( stream ); -
316 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
317 ( error = _HB_OPEN_Load_Device( &vr->DeviceTables[2], 0
318 stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Device( &vr->DeviceTables[2], stream ) ) != HB_Err_Ok
0
319 goto Fail2;
never executed: goto Fail2;
0
320 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
321 }
never executed: }
0
322 }
never executed: }
0
323 -
324 if ( format & 0x0080 )
partially evaluated: format & 0x0080
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:14
0-14
325 { -
326 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
327 goto Fail1;
never executed: goto Fail1;
0
328 -
329 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
330 -
331 _hb_stream_frame_exit( stream ); -
332 -
333 if ( new_offset )
never evaluated: new_offset
0
334 { -
335 new_offset += base_offset; -
336 -
337 cur_offset = _hb_stream_pos( stream ); -
338 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
339 ( error = _HB_OPEN_Load_Device( &vr->DeviceTables[3], 0
340 stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Device( &vr->DeviceTables[3], stream ) ) != HB_Err_Ok
0
341 goto Fail1;
never executed: goto Fail1;
0
342 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
343 }
never executed: }
0
344 }
never executed: }
0
345 -
346 if ( format & 0x0100 )
partially evaluated: format & 0x0100
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:14
0-14
347 { -
348 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
349 goto Fail1;
never executed: goto Fail1;
0
350 -
351 -
352 -
353 -
354 (void) ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
355 -
356 -
357 _hb_stream_frame_exit( stream ); -
358 }
never executed: }
0
359 -
360 -
361 -
362 -
363 -
364 if ( format & 0x0200 )
partially evaluated: format & 0x0200
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:14
0-14
365 { -
366 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
367 goto Fail1;
never executed: goto Fail1;
0
368 -
369 -
370 -
371 -
372 (void) ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
373 -
374 -
375 _hb_stream_frame_exit( stream ); -
376 }
never executed: }
0
377 -
378 -
379 -
380 -
381 -
382 if ( format & 0x0400 )
partially evaluated: format & 0x0400
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:14
0-14
383 { -
384 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
385 goto Fail1;
never executed: goto Fail1;
0
386 -
387 -
388 -
389 -
390 (void) ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
391 -
392 -
393 _hb_stream_frame_exit( stream ); -
394 }
never executed: }
0
395 -
396 -
397 -
398 -
399 -
400 if ( format & 0x0800 )
partially evaluated: format & 0x0800
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:14
0-14
401 { -
402 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
403 goto Fail1;
never executed: goto Fail1;
0
404 -
405 -
406 -
407 -
408 (void) ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
409 -
410 -
411 _hb_stream_frame_exit( stream ); -
412 }
never executed: }
0
413 -
414 -
415 -
416 -
417 -
418 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:14
14
419 -
420Fail1: -
421 if ( vr->DeviceTables )
never evaluated: vr->DeviceTables
0
422 _HB_OPEN_Free_Device( vr->DeviceTables[3] );
never executed: _HB_OPEN_Free_Device( vr->DeviceTables[3] );
0
423 -
424Fail2:
code before this statement never executed: Fail2:
0
425 if ( vr->DeviceTables )
never evaluated: vr->DeviceTables
0
426 _HB_OPEN_Free_Device( vr->DeviceTables[2] );
never executed: _HB_OPEN_Free_Device( vr->DeviceTables[2] );
0
427 -
428Fail3:
code before this statement never executed: Fail3:
0
429 if ( vr->DeviceTables )
never evaluated: vr->DeviceTables
0
430 _HB_OPEN_Free_Device( vr->DeviceTables[1] );
never executed: _HB_OPEN_Free_Device( vr->DeviceTables[1] );
0
431 -
432Fail4:
code before this statement never executed: Fail4:
0
433 do { if ( (vr->DeviceTables) ) { _hb_free( vr->DeviceTables ); vr->DeviceTables = ((void *)0); } } while (0);
never evaluated: (vr->DeviceTables)
never evaluated: 0
never executed: }
never executed: }
0
434 return error;
never executed: return error;
0
435} -
436 -
437 -
438static void Free_ValueRecord( HB_ValueRecord* vr, -
439 HB_UShort format ) -
440{ -
441 if ( format & 0x0080 )
partially evaluated: format & 0x0080
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12
0-12
442 _HB_OPEN_Free_Device( vr->DeviceTables[3] );
never executed: _HB_OPEN_Free_Device( vr->DeviceTables[3] );
0
443 if ( format & 0x0040 )
partially evaluated: format & 0x0040
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12
0-12
444 _HB_OPEN_Free_Device( vr->DeviceTables[2] );
never executed: _HB_OPEN_Free_Device( vr->DeviceTables[2] );
0
445 if ( format & 0x0020 )
partially evaluated: format & 0x0020
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12
0-12
446 _HB_OPEN_Free_Device( vr->DeviceTables[1] );
never executed: _HB_OPEN_Free_Device( vr->DeviceTables[1] );
0
447 if ( format & 0x0010 )
partially evaluated: format & 0x0010
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12
0-12
448 _HB_OPEN_Free_Device( vr->DeviceTables[0] );
never executed: _HB_OPEN_Free_Device( vr->DeviceTables[0] );
0
449 do { if ( (vr->DeviceTables) ) { _hb_free( vr->DeviceTables ); vr->DeviceTables = ((void *)0); } } while (0);
partially evaluated: (vr->DeviceTables)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12
never executed: }
executed: }
Execution Count:12
0-12
450}
executed: }
Execution Count:12
12
451 -
452 -
453static HB_Error Get_ValueRecord( GPOS_Instance* gpi, -
454 HB_ValueRecord* vr, -
455 HB_UShort format, -
456 HB_Position gd ) -
457{ -
458 HB_Short pixel_value; -
459 HB_Error error = HB_Err_Ok; -
460 -
461 -
462 -
463 -
464 -
465 HB_UShort x_ppem, y_ppem; -
466 HB_16Dot16 x_scale, y_scale; -
467 -
468 -
469 if ( !format )
never evaluated: !format
0
470 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
471 -
472 x_ppem = gpi->font->x_ppem; -
473 y_ppem = gpi->font->y_ppem; -
474 x_scale = gpi->font->x_scale; -
475 y_scale = gpi->font->y_scale; -
476 -
477 -
478 -
479 if ( format & 0x0001 )
never evaluated: format & 0x0001
0
480 gd->x_pos += x_scale * vr->XPlacement / 0x10000;
never executed: gd->x_pos += x_scale * vr->XPlacement / 0x10000;
0
481 if ( format & 0x0002 )
never evaluated: format & 0x0002
0
482 gd->y_pos += y_scale * vr->YPlacement / 0x10000;
never executed: gd->y_pos += y_scale * vr->YPlacement / 0x10000;
0
483 if ( format & 0x0004 )
never evaluated: format & 0x0004
0
484 gd->x_advance += x_scale * vr->XAdvance / 0x10000;
never executed: gd->x_advance += x_scale * vr->XAdvance / 0x10000;
0
485 if ( format & 0x0008 )
never evaluated: format & 0x0008
0
486 gd->y_advance += y_scale * vr->YAdvance / 0x10000;
never executed: gd->y_advance += y_scale * vr->YAdvance / 0x10000;
0
487 -
488 if ( !gpi->dvi )
never evaluated: !gpi->dvi
0
489 { -
490 -
491 -
492 if ( format & 0x0010 )
never evaluated: format & 0x0010
0
493 { -
494 _HB_OPEN_Get_Device( vr->DeviceTables[0], x_ppem, &pixel_value ); -
495 gd->x_pos += pixel_value << 6; -
496 }
never executed: }
0
497 if ( format & 0x0020 )
never evaluated: format & 0x0020
0
498 { -
499 _HB_OPEN_Get_Device( vr->DeviceTables[1], y_ppem, &pixel_value ); -
500 gd->y_pos += pixel_value << 6; -
501 }
never executed: }
0
502 if ( format & 0x0040 )
never evaluated: format & 0x0040
0
503 { -
504 _HB_OPEN_Get_Device( vr->DeviceTables[2], x_ppem, &pixel_value ); -
505 gd->x_advance += pixel_value << 6; -
506 }
never executed: }
0
507 if ( format & 0x0080 )
never evaluated: format & 0x0080
0
508 { -
509 _HB_OPEN_Get_Device( vr->DeviceTables[3], y_ppem, &pixel_value ); -
510 gd->y_advance += pixel_value << 6; -
511 }
never executed: }
0
512 }
never executed: }
0
513 return error;
never executed: return error;
0
514} -
515 -
516 -
517 -
518 -
519 -
520 -
521 -
522static HB_Error Load_Anchor( HB_Anchor* an, -
523 HB_Stream stream ) -
524{ -
525 HB_Error error; -
526 -
527 HB_UInt cur_offset, new_offset, base_offset; -
528 -
529 -
530 base_offset = _hb_stream_pos( stream ); -
531 -
532 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:371584
0-371584
533 return error;
never executed: return error;
0
534 -
535 an->PosFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
536 -
537 _hb_stream_frame_exit( stream ); -
538 -
539 switch ( an->PosFormat ) -
540 { -
541 case 1: -
542 if ( ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:366135
0-366135
543 return error;
never executed: return error;
0
544 -
545 an->af.af1.XCoordinate = (stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )); -
546 an->af.af1.YCoordinate = (stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )); -
547 -
548 _hb_stream_frame_exit( stream ); -
549 break;
executed: break;
Execution Count:366135
366135
550 -
551 case 2: -
552 if ( ( (error = (_hb_stream_frame_enter( stream, 6L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 6L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5230
0-5230
553 return error;
never executed: return error;
0
554 -
555 an->af.af2.XCoordinate = (stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )); -
556 an->af.af2.YCoordinate = (stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )); -
557 an->af.af2.AnchorPoint = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
558 -
559 _hb_stream_frame_exit( stream ); -
560 break;
executed: break;
Execution Count:5230
5230
561 -
562 case 3: -
563 if ( ( (error = (_hb_stream_frame_enter( stream, 6L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 6L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:219
0-219
564 return error;
never executed: return error;
0
565 -
566 an->af.af3.XCoordinate = (stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )); -
567 an->af.af3.YCoordinate = (stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )); -
568 -
569 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
570 -
571 _hb_stream_frame_exit( stream ); -
572 -
573 if ( new_offset )
evaluated: new_offset
TRUEFALSE
yes
Evaluation Count:75
yes
Evaluation Count:144
75-144
574 { -
575 if ( ( (an->af.af3.DeviceTables) = _hb_alloc( (2)*sizeof(HB_Device), &error ), error != 0 ) )
partially evaluated: ( (an->af.af3.DeviceTables) = _hb_alloc( (2)*sizeof(HB_Device), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:75
0-75
576 return error;
never executed: return error;
0
577 -
578 an->af.af3.DeviceTables[0] = 0; -
579 an->af.af3.DeviceTables[1] = 0; -
580 -
581 new_offset += base_offset; -
582 -
583 cur_offset = _hb_stream_pos( stream ); -
584 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:75
0-75
585 ( error = _HB_OPEN_Load_Device( &an->af.af3.DeviceTables[0], 0-75
586 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_Device( &an->af.af3.DeviceTables[0], stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:75
0-75
587 goto Fail2;
never executed: goto Fail2;
0
588 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
589 }
executed: }
Execution Count:75
75
590 -
591 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:219
0-219
592 goto Fail;
never executed: goto Fail;
0
593 -
594 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
595 -
596 _hb_stream_frame_exit( stream ); -
597 -
598 if ( new_offset )
evaluated: new_offset
TRUEFALSE
yes
Evaluation Count:150
yes
Evaluation Count:69
69-150
599 { -
600 if ( !an->af.af3.DeviceTables )
evaluated: !an->af.af3.DeviceTables
TRUEFALSE
yes
Evaluation Count:144
yes
Evaluation Count:6
6-144
601 { -
602 if ( ( (an->af.af3.DeviceTables) = _hb_alloc( (2)*sizeof(HB_Device), &error ), error != 0 ) )
partially evaluated: ( (an->af.af3.DeviceTables) = _hb_alloc( (2)*sizeof(HB_Device), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:144
0-144
603 return error;
never executed: return error;
0
604 -
605 an->af.af3.DeviceTables[0] = 0; -
606 an->af.af3.DeviceTables[1] = 0; -
607 }
executed: }
Execution Count:144
144
608 -
609 new_offset += base_offset; -
610 -
611 cur_offset = _hb_stream_pos( stream ); -
612 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:150
0-150
613 ( error = _HB_OPEN_Load_Device( &an->af.af3.DeviceTables[1], 0-150
614 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_Device( &an->af.af3.DeviceTables[1], stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:150
0-150
615 goto Fail;
never executed: goto Fail;
0
616 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
617 }
executed: }
Execution Count:150
150
618 break;
executed: break;
Execution Count:219
219
619 -
620 case 4: -
621 if ( ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
0
622 return error;
never executed: return error;
0
623 -
624 -
625 -
626 -
627 -
628 (void) ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
629 (void) ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
630 -
631 -
632 _hb_stream_frame_exit( stream ); -
633 break;
never executed: break;
0
634 -
635 default: -
636 return _hb_err (HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
637 } -
638 -
639 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:371584
371584
640 -
641Fail: -
642 if ( an->af.af3.DeviceTables )
never evaluated: an->af.af3.DeviceTables
0
643 _HB_OPEN_Free_Device( an->af.af3.DeviceTables[0] );
never executed: _HB_OPEN_Free_Device( an->af.af3.DeviceTables[0] );
0
644 -
645Fail2:
code before this statement never executed: Fail2:
0
646 do { if ( (an->af.af3.DeviceTables) ) { _hb_free( an->af.af3.DeviceTables ); an->af.af3.DeviceTables = ((void *)0); } } while (0);
never executed: }
never executed: }
never evaluated: (an->af.af3.DeviceTables)
never evaluated: 0
0
647 return error;
never executed: return error;
0
648} -
649 -
650 -
651static void Free_Anchor( HB_Anchor* an) -
652{ -
653 if ( an->PosFormat == 3 && an->af.af3.DeviceTables )
evaluated: an->PosFormat == 3
TRUEFALSE
yes
Evaluation Count:116
yes
Evaluation Count:341345
partially evaluated: an->af.af3.DeviceTables
TRUEFALSE
yes
Evaluation Count:116
no
Evaluation Count:0
0-341345
654 { -
655 _HB_OPEN_Free_Device( an->af.af3.DeviceTables[0] ); -
656 _HB_OPEN_Free_Device( an->af.af3.DeviceTables[1] ); -
657 do { if ( (an->af.af3.DeviceTables) ) { _hb_free( an->af.af3.DeviceTables ); an->af.af3.DeviceTables = ((void *)0); } } while (0);
executed: }
Execution Count:116
executed: }
Execution Count:116
partially evaluated: (an->af.af3.DeviceTables)
TRUEFALSE
yes
Evaluation Count:116
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:116
0-116
658 }
executed: }
Execution Count:116
116
659}
executed: }
Execution Count:341461
341461
660 -
661 -
662static HB_Error Get_Anchor( GPOS_Instance* gpi, -
663 HB_Anchor* an, -
664 HB_UShort glyph_index, -
665 HB_Fixed* x_value, -
666 HB_Fixed* y_value ) -
667{ -
668 HB_Error error = HB_Err_Ok; -
669 -
670 -
671 -
672 -
673 HB_UShort ap; -
674 -
675 HB_Short pixel_value; -
676 -
677 HB_UShort x_ppem, y_ppem; -
678 HB_16Dot16 x_scale, y_scale; -
679 -
680 -
681 x_ppem = gpi->font->x_ppem; -
682 y_ppem = gpi->font->y_ppem; -
683 x_scale = gpi->font->x_scale; -
684 y_scale = gpi->font->y_scale; -
685 -
686 switch ( an->PosFormat ) -
687 { -
688 case 0: -
689 -
690 default: -
691 -
692 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
693 -
694 case 1: -
695 *x_value = x_scale * an->af.af1.XCoordinate / 0x10000; -
696 *y_value = y_scale * an->af.af1.YCoordinate / 0x10000; -
697 break;
executed: break;
Execution Count:2400
2400
698 -
699 case 2: -
700 if ( !gpi->dvi )
never evaluated: !gpi->dvi
0
701 { -
702 hb_uint32 n_points = 0; -
703 ap = an->af.af2.AnchorPoint; -
704 if (!gpi->font->klass->getPointInOutline)
never evaluated: !gpi->font->klass->getPointInOutline
0
705 goto no_contour_point;
never executed: goto no_contour_point;
0
706 error = gpi->font->klass->getPointInOutline(gpi->font, glyph_index, gpi->load_flags, ap, x_value, y_value, &n_points); -
707 if (error)
never evaluated: error
0
708 return error;
never executed: return error;
0
709 -
710 -
711 if (!n_points)
never evaluated: !n_points
0
712 goto no_contour_point;
never executed: goto no_contour_point;
0
713 }
never executed: }
0
714 else -
715 { -
716 no_contour_point: -
717 *x_value = x_scale * an->af.af3.XCoordinate / 0x10000; -
718 *y_value = y_scale * an->af.af3.YCoordinate / 0x10000; -
719 }
never executed: }
0
720 break;
never executed: break;
0
721 -
722 case 3: -
723 if ( !gpi->dvi )
partially evaluated: !gpi->dvi
TRUEFALSE
yes
Evaluation Count:48
no
Evaluation Count:0
0-48
724 { -
725 _HB_OPEN_Get_Device( an->af.af3.DeviceTables[0], x_ppem, &pixel_value ); -
726 *x_value = pixel_value << 6; -
727 _HB_OPEN_Get_Device( an->af.af3.DeviceTables[1], y_ppem, &pixel_value ); -
728 *y_value = pixel_value << 6; -
729 }
executed: }
Execution Count:48
48
730 else -
731 *x_value = *y_value = 0;
never executed: *x_value = *y_value = 0;
0
732 -
733 *x_value += x_scale * an->af.af3.XCoordinate / 0x10000; -
734 *y_value += y_scale * an->af.af3.YCoordinate / 0x10000; -
735 break;
executed: break;
Execution Count:48
48
736 -
737 case 4: -
738 return _hb_err (HB_Err_Not_Covered);
never executed: return _hb_err (HB_Err_Not_Covered);
0
739 -
740 } -
741 -
742 return error;
executed: return error;
Execution Count:2448
2448
743} -
744 -
745 -
746 -
747 -
748static HB_Error Load_MarkArray ( HB_MarkArray* ma, -
749 HB_Stream stream ) -
750{ -
751 HB_Error error; -
752 -
753 HB_UShort n, m, count; -
754 HB_UInt cur_offset, new_offset, base_offset; -
755 -
756 HB_MarkRecord* mr; -
757 -
758 -
759 base_offset = _hb_stream_pos( stream ); -
760 -
761 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2394
0-2394
762 return error;
never executed: return error;
0
763 -
764 count = ma->MarkCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
765 -
766 _hb_stream_frame_exit( stream ); -
767 -
768 ma->MarkRecord = ((void *)0); -
769 -
770 if ( ( (ma->MarkRecord) = _hb_alloc( (count)*sizeof(HB_MarkRecord), &error ), error != 0 ) )
partially evaluated: ( (ma->MarkRecord) = _hb_alloc( (count)*sizeof(HB_MarkRecord), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2394
0-2394
771 return error;
never executed: return error;
0
772 -
773 mr = ma->MarkRecord; -
774 -
775 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:44292
yes
Evaluation Count:2394
2394-44292
776 { -
777 if ( ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:44292
0-44292
778 goto Fail;
never executed: goto Fail;
0
779 -
780 mr[n].Class = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
781 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
782 -
783 _hb_stream_frame_exit( stream ); -
784 -
785 cur_offset = _hb_stream_pos( stream ); -
786 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:44292
0-44292
787 ( error = Load_Anchor( &mr[n].MarkAnchor, stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_Anchor( &mr[n].MarkAnchor, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:44292
0-44292
788 goto Fail;
never executed: goto Fail;
0
789 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
790 }
executed: }
Execution Count:44292
44292
791 -
792 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:2394
2394
793 -
794Fail: -
795 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
796 Free_Anchor( &mr[m].MarkAnchor );
never executed: Free_Anchor( &mr[m].MarkAnchor );
0
797 -
798 do { if ( (mr) ) { _hb_free( mr ); mr = ((void *)0); } } while (0);
never evaluated: (mr)
never executed: }
never executed: }
never evaluated: 0
0
799 return error;
never executed: return error;
0
800} -
801 -
802 -
803static void Free_MarkArray( HB_MarkArray* ma ) -
804{ -
805 HB_UShort n, count; -
806 -
807 HB_MarkRecord* mr; -
808 -
809 -
810 if ( ma->MarkRecord )
partially evaluated: ma->MarkRecord
TRUEFALSE
yes
Evaluation Count:2271
no
Evaluation Count:0
0-2271
811 { -
812 count = ma->MarkCount; -
813 mr = ma->MarkRecord; -
814 -
815 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:42044
yes
Evaluation Count:2271
2271-42044
816 Free_Anchor( &mr[n].MarkAnchor );
executed: Free_Anchor( &mr[n].MarkAnchor );
Execution Count:42044
42044
817 -
818 do { if ( (mr) ) { _hb_free( mr ); mr = ((void *)0); } } while (0);
partially evaluated: (mr)
TRUEFALSE
yes
Evaluation Count:2271
no
Evaluation Count:0
executed: }
Execution Count:2271
executed: }
Execution Count:2271
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2271
0-2271
819 }
executed: }
Execution Count:2271
2271
820}
executed: }
Execution Count:2271
2271
821 -
822 -
823 -
824 -
825 -
826 -
827 -
828static HB_Error Load_SinglePos( HB_GPOS_SubTable* st, -
829 HB_Stream stream ) -
830{ -
831 HB_Error error; -
832 HB_SinglePos* sp = &st->single; -
833 -
834 HB_UShort n, m, count, format; -
835 HB_UInt cur_offset, new_offset, base_offset; -
836 -
837 HB_ValueRecord* vr; -
838 -
839 -
840 base_offset = _hb_stream_pos( stream ); -
841 -
842 if ( ( (error = (_hb_stream_frame_enter( stream, 6L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 6L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:14
0-14
843 return error;
never executed: return error;
0
844 -
845 sp->PosFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
846 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
847 -
848 format = sp->ValueFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
849 -
850 _hb_stream_frame_exit( stream ); -
851 -
852 if ( !format )
partially evaluated: !format
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:14
0-14
853 return _hb_err (HB_Err_Invalid_SubTable);
never executed: return _hb_err (HB_Err_Invalid_SubTable);
0
854 -
855 cur_offset = _hb_stream_pos( stream ); -
856 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:14
0-14
857 ( error = _HB_OPEN_Load_Coverage( &sp->Coverage, stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_Coverage( &sp->Coverage, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:14
0-14
858 return error;
never executed: return error;
0
859 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
860 -
861 switch ( sp->PosFormat ) -
862 { -
863 case 1: -
864 error = Load_ValueRecord( &sp->spf.spf1.Value, format, -
865 base_offset, stream ); -
866 if ( error )
partially evaluated: error
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:14
0-14
867 goto Fail2;
never executed: goto Fail2;
0
868 break;
executed: break;
Execution Count:14
14
869 -
870 case 2: -
871 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
872 goto Fail2;
never executed: goto Fail2;
0
873 -
874 count = sp->spf.spf2.ValueCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
875 -
876 _hb_stream_frame_exit( stream ); -
877 -
878 sp->spf.spf2.Value = ((void *)0); -
879 -
880 if ( ( (sp->spf.spf2.Value) = _hb_alloc( (count)*sizeof(HB_ValueRecord), &error ), error != 0 ) )
never evaluated: ( (sp->spf.spf2.Value) = _hb_alloc( (count)*sizeof(HB_ValueRecord), &error ), error != 0 )
0
881 goto Fail2;
never executed: goto Fail2;
0
882 -
883 vr = sp->spf.spf2.Value; -
884 -
885 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
886 { -
887 error = Load_ValueRecord( &vr[n], format, base_offset, stream ); -
888 if ( error )
never evaluated: error
0
889 goto Fail1;
never executed: goto Fail1;
0
890 }
never executed: }
0
891 break;
never executed: break;
0
892 -
893 default: -
894 return _hb_err (HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
895 } -
896 -
897 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:14
14
898 -
899Fail1: -
900 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
901 Free_ValueRecord( &vr[m], format );
never executed: Free_ValueRecord( &vr[m], format );
0
902 -
903 do { if ( (vr) ) { _hb_free( vr ); vr = ((void *)0); } } while (0);
never evaluated: (vr)
never executed: }
never executed: }
never evaluated: 0
0
904 -
905Fail2:
code before this statement never executed: Fail2:
0
906 _HB_OPEN_Free_Coverage( &sp->Coverage ); -
907 return error;
never executed: return error;
0
908} -
909 -
910 -
911static void Free_SinglePos( HB_GPOS_SubTable* st ) -
912{ -
913 HB_UShort n, count, format; -
914 HB_SinglePos* sp = &st->single; -
915 -
916 HB_ValueRecord* v; -
917 -
918 -
919 format = sp->ValueFormat; -
920 -
921 switch ( sp->PosFormat ) -
922 { -
923 case 1: -
924 Free_ValueRecord( &sp->spf.spf1.Value, format ); -
925 break;
executed: break;
Execution Count:12
12
926 -
927 case 2: -
928 if ( sp->spf.spf2.Value )
never evaluated: sp->spf.spf2.Value
0
929 { -
930 count = sp->spf.spf2.ValueCount; -
931 v = sp->spf.spf2.Value; -
932 -
933 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
934 Free_ValueRecord( &v[n], format );
never executed: Free_ValueRecord( &v[n], format );
0
935 -
936 do { if ( (v) ) { _hb_free( v ); v = ((void *)0); } } while (0);
never evaluated: (v)
never executed: }
never executed: }
never evaluated: 0
0
937 }
never executed: }
0
938 break;
never executed: break;
0
939 default: -
940 break;
never executed: break;
0
941 } -
942 -
943 _HB_OPEN_Free_Coverage( &sp->Coverage ); -
944}
executed: }
Execution Count:12
12
945 -
946static HB_Error Lookup_SinglePos( GPOS_Instance* gpi, -
947 HB_GPOS_SubTable* st, -
948 HB_Buffer buffer, -
949 HB_UShort flags, -
950 HB_UShort context_length, -
951 int nesting_level ) -
952{ -
953 HB_UShort index, property; -
954 HB_Error error; -
955 HB_GPOSHeader* gpos = gpi->gpos; -
956 HB_SinglePos* sp = &st->single; -
957 -
958 ((nesting_level) = (nesting_level)); -
959 -
960 if ( context_length != 0xFFFF && context_length < 1 )
partially evaluated: context_length != 0xFFFF
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:11
never evaluated: context_length < 1
0-11
961 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
962 -
963 if ( ( ( error = _HB_GDEF_Check_Property( (gpos->gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok ) )
partially evaluated: ( ( error = _HB_GDEF_Check_Property( (gpos->gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:11
0-11
964 return error;
never executed: return error;
0
965 -
966 error = _HB_OPEN_Coverage_Index( &sp->Coverage, (buffer->in_string[buffer->in_pos].gindex), &index ); -
967 if ( error )
partially evaluated: error
TRUEFALSE
yes
Evaluation Count:11
no
Evaluation Count:0
0-11
968 return error;
executed: return error;
Execution Count:11
11
969 -
970 switch ( sp->PosFormat ) -
971 { -
972 case 1: -
973 error = Get_ValueRecord( gpi, &sp->spf.spf1.Value, -
974 sp->ValueFormat, (&buffer->positions[(buffer->in_pos)]) ); -
975 if ( error )
never evaluated: error
0
976 return error;
never executed: return error;
0
977 break;
never executed: break;
0
978 -
979 case 2: -
980 if ( index >= sp->spf.spf2.ValueCount )
never evaluated: index >= sp->spf.spf2.ValueCount
0
981 return _hb_err (HB_Err_Invalid_SubTable);
never executed: return _hb_err (HB_Err_Invalid_SubTable);
0
982 error = Get_ValueRecord( gpi, &sp->spf.spf2.Value[index], -
983 sp->ValueFormat, (&buffer->positions[(buffer->in_pos)]) ); -
984 if ( error )
never evaluated: error
0
985 return error;
never executed: return error;
0
986 break;
never executed: break;
0
987 -
988 default: -
989 return _hb_err (HB_Err_Invalid_SubTable);
never executed: return _hb_err (HB_Err_Invalid_SubTable);
0
990 } -
991 -
992 (buffer->in_pos)++; -
993 -
994 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
995} -
996 -
997 -
998 -
999 -
1000 -
1001static HB_Error Load_PairSet ( HB_PairSet* ps, -
1002 HB_UShort format1, -
1003 HB_UShort format2, -
1004 HB_Stream stream ) -
1005{ -
1006 HB_Error error; -
1007 -
1008 HB_UShort n, m, count; -
1009 -
1010 -
1011 HB_UInt record_size = 0; -
1012 HB_Short *vr; -
1013 -
1014 -
1015 -
1016 -
1017 -
1018 -
1019 -
1020 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:205
0-205
1021 return error;
never executed: return error;
0
1022 -
1023 count = ps->PairValueCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1024 -
1025 _hb_stream_frame_exit( stream ); -
1026 ps->ValueRecords = 0; -
1027 -
1028 -
1029 record_size = Calculate_Class2RecordSize( format1, format2 ) + 1; -
1030 -
1031 if ( ( (ps->ValueRecords) = _hb_alloc( (record_size * count)*sizeof(HB_Short), &error ), error != 0 ) )
partially evaluated: ( (ps->ValueRecords) = _hb_alloc( (record_size * count)*sizeof(HB_Short), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:205
0-205
1032 return error;
never executed: return error;
0
1033 -
1034 vr = ps->ValueRecords; -
1035 -
1036 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:2411
yes
Evaluation Count:205
205-2411
1037 { -
1038 for ( m = 0; m < record_size; m++ ) {
evaluated: m < record_size
TRUEFALSE
yes
Evaluation Count:4822
yes
Evaluation Count:2411
2411-4822
1039 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4822
0-4822
1040 goto Fail;
never executed: goto Fail;
0
1041 -
1042 *(vr++) = (stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )); -
1043 -
1044 _hb_stream_frame_exit( stream ); -
1045 }
executed: }
Execution Count:4822
4822
1046 }
executed: }
Execution Count:2411
2411
1047 -
1048 -
1049 -
1050 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:205
205
1051 -
1052Fail: -
1053 do { if ( (ps->ValueRecords) ) { _hb_free( ps->ValueRecords ); ps->ValueRecords = ((void *)0); } } while (0);
never evaluated: (ps->ValueRecords)
never evaluated: 0
never executed: }
never executed: }
0
1054 -
1055 -
1056 return error;
never executed: return error;
0
1057} -
1058 -
1059 -
1060static void Free_PairSet( HB_PairSet* ps, -
1061 HB_UShort format1, -
1062 HB_UShort format2) -
1063{ -
1064 (void)format1; -
1065 (void)format2; -
1066 -
1067 if ( ps->ValueRecords )
partially evaluated: ps->ValueRecords
TRUEFALSE
yes
Evaluation Count:205
no
Evaluation Count:0
0-205
1068 { -
1069 do { if ( (ps->ValueRecords) ) { _hb_free( ps->ValueRecords ); ps->ValueRecords = ((void *)0); } } while (0);
partially evaluated: (ps->ValueRecords)
TRUEFALSE
yes
Evaluation Count:205
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:205
executed: }
Execution Count:205
executed: }
Execution Count:205
0-205
1070 }
executed: }
Execution Count:205
205
1071 -
1072}
executed: }
Execution Count:205
205
1073 -
1074 -
1075 -
1076 -
1077static HB_Error Load_PairPos1( HB_PairPosFormat1* ppf1, -
1078 HB_UShort format1, -
1079 HB_UShort format2, -
1080 HB_Stream stream ) -
1081{ -
1082 HB_Error error; -
1083 -
1084 HB_UShort n, m, count; -
1085 HB_UInt cur_offset, new_offset, base_offset; -
1086 -
1087 HB_PairSet* ps; -
1088 -
1089 -
1090 base_offset = _hb_stream_pos( stream ) - 8L; -
1091 -
1092 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
1093 return error;
never executed: return error;
0
1094 -
1095 count = ppf1->PairSetCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1096 -
1097 _hb_stream_frame_exit( stream ); -
1098 -
1099 ppf1->PairSet = ((void *)0); -
1100 -
1101 if ( ( (ppf1->PairSet) = _hb_alloc( (count)*sizeof(HB_PairSet), &error ), error != 0 ) )
partially evaluated: ( (ppf1->PairSet) = _hb_alloc( (count)*sizeof(HB_PairSet), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
1102 return error;
never executed: return error;
0
1103 -
1104 ps = ppf1->PairSet; -
1105 -
1106 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:205
yes
Evaluation Count:3
3-205
1107 { -
1108 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:205
0-205
1109 goto Fail;
never executed: goto Fail;
0
1110 -
1111 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
1112 -
1113 _hb_stream_frame_exit( stream ); -
1114 -
1115 cur_offset = _hb_stream_pos( stream ); -
1116 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:205
0-205
1117 ( error = Load_PairSet( &ps[n], format1, 0-205
1118 format2, stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_PairSet( &ps[n], format1, format2, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:205
0-205
1119 goto Fail;
never executed: goto Fail;
0
1120 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
1121 }
executed: }
Execution Count:205
205
1122 -
1123 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:3
3
1124 -
1125Fail: -
1126 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
1127 Free_PairSet( &ps[m], format1, format2 );
never executed: Free_PairSet( &ps[m], format1, format2 );
0
1128 -
1129 do { if ( (ps) ) { _hb_free( ps ); ps = ((void *)0); } } while (0);
never evaluated: (ps)
never evaluated: 0
never executed: }
never executed: }
0
1130 return error;
never executed: return error;
0
1131} -
1132 -
1133 -
1134static void Free_PairPos1( HB_PairPosFormat1* ppf1, -
1135 HB_UShort format1, -
1136 HB_UShort format2 ) -
1137{ -
1138 HB_UShort n, count; -
1139 -
1140 HB_PairSet* ps; -
1141 -
1142 -
1143 if ( ppf1->PairSet )
partially evaluated: ppf1->PairSet
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-3
1144 { -
1145 count = ppf1->PairSetCount; -
1146 ps = ppf1->PairSet; -
1147 -
1148 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:205
yes
Evaluation Count:3
3-205
1149 Free_PairSet( &ps[n], format1, format2 );
executed: Free_PairSet( &ps[n], format1, format2 );
Execution Count:205
205
1150 -
1151 do { if ( (ps) ) { _hb_free( ps ); ps = ((void *)0); } } while (0);
partially evaluated: (ps)
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
executed: }
Execution Count:3
executed: }
Execution Count:3
0-3
1152 }
executed: }
Execution Count:3
3
1153}
executed: }
Execution Count:3
3
1154 -
1155 -
1156 -
1157 -
1158static HB_Error Load_PairPos2( HB_PairPosFormat2* ppf2, -
1159 HB_UShort format1, -
1160 HB_UShort format2, -
1161 HB_Stream stream ) -
1162{ -
1163 HB_Error error; -
1164 -
1165 HB_UShort m, n, k, count1, count2; -
1166 HB_UInt cur_offset, new_offset1, new_offset2, base_offset, cls2_record_size = 0; -
1167 -
1168 HB_Class1Record* c1r; -
1169 HB_Class2Record* c2r; -
1170 -
1171 HB_Short* vr; -
1172 -
1173 hb_uint8 use_flexible_value_records; -
1174 -
1175 base_offset = _hb_stream_pos( stream ) - 8L; -
1176 -
1177 if ( ( (error = (_hb_stream_frame_enter( stream, 8L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 8L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:273
0-273
1178 return error;
never executed: return error;
0
1179 -
1180 new_offset1 = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
1181 new_offset2 = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
1182 -
1183 -
1184 -
1185 -
1186 count1 = ppf2->Class1Count = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1187 count2 = ppf2->Class2Count = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1188 -
1189 -
1190 -
1191 -
1192 use_flexible_value_records = !((format1 & 0x00F0) ||
partially evaluated: (format1 & 0x00F0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:273
0-273
1193 (format2 & 0x00F0));
partially evaluated: (format2 & 0x00F0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:273
0-273
1194 -
1195 -
1196 _hb_stream_frame_exit( stream ); -
1197 -
1198 cur_offset = _hb_stream_pos( stream ); -
1199 if ( ( (error = (_hb_stream_seek( stream, new_offset1 ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset1 ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:273
0-273
1200 ( error = _HB_OPEN_Load_ClassDefinition( &ppf2->ClassDef1, count1, 0-273
1201 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_ClassDefinition( &ppf2->ClassDef1, count1, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:273
0-273
1202 return error;
never executed: return error;
0
1203 if ( ( (error = (_hb_stream_seek( stream, new_offset2 ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset2 ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:273
0-273
1204 ( error = _HB_OPEN_Load_ClassDefinition( &ppf2->ClassDef2, count2, 0-273
1205 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_ClassDefinition( &ppf2->ClassDef2, count2, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:273
0-273
1206 goto Fail3;
never executed: goto Fail3;
0
1207 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
1208 -
1209 ppf2->Class1Record = ((void *)0); -
1210 -
1211 if ( ( (ppf2->Class1Record) = _hb_alloc( (count1)*sizeof(HB_Class1Record), &error ), error != 0 ) )
partially evaluated: ( (ppf2->Class1Record) = _hb_alloc( (count1)*sizeof(HB_Class1Record), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:273
0-273
1212 goto Fail2;
never executed: goto Fail2;
0
1213 -
1214 c1r = ppf2->Class1Record; -
1215 -
1216 if ( use_flexible_value_records )
partially evaluated: use_flexible_value_records
TRUEFALSE
yes
Evaluation Count:273
no
Evaluation Count:0
0-273
1217 cls2_record_size = Calculate_Class2RecordSize(format1, format2);
executed: cls2_record_size = Calculate_Class2RecordSize(format1, format2);
Execution Count:273
273
1218 -
1219 for ( m = 0; m < count1; m++ )
evaluated: m < count1
TRUEFALSE
yes
Evaluation Count:7018
yes
Evaluation Count:273
273-7018
1220 { -
1221 c1r[m].IsFlexible = use_flexible_value_records; -
1222 if ( use_flexible_value_records ) {
partially evaluated: use_flexible_value_records
TRUEFALSE
yes
Evaluation Count:7018
no
Evaluation Count:0
0-7018
1223 c1r[m].c2r.ValueRecords = ((void *)0); -
1224 -
1225 if ( ( (c1r[m].c2r.ValueRecords) = _hb_alloc( (count2 * cls2_record_size)*sizeof(HB_UShort), &error ), error != 0 ) )
partially evaluated: ( (c1r[m].c2r.ValueRecords) = _hb_alloc( (count2 * cls2_record_size)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7018
0-7018
1226 goto Fail1;
never executed: goto Fail1;
0
1227 -
1228 vr = c1r[m].c2r.ValueRecords; -
1229 -
1230 if ( ( (error = (_hb_stream_frame_enter( stream, count2 * cls2_record_size * 2L ))) != 0 ))
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, count2 * cls2_record_size * 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7018
0-7018
1231 goto Fail1;
never executed: goto Fail1;
0
1232 -
1233 for ( n = 0; n < count2 * cls2_record_size; n++ )
evaluated: n < count2 * cls2_record_size
TRUEFALSE
yes
Evaluation Count:457511
yes
Evaluation Count:7018
7018-457511
1234 vr[n] = (stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ));
executed: vr[n] = (stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ));
Execution Count:457511
457511
1235 -
1236 _hb_stream_frame_exit( stream ); -
1237 } else {
executed: }
Execution Count:7018
7018
1238 c1r[m].c2r.Class2Record = ((void *)0); -
1239 -
1240 if ( ( (c1r[m].c2r.Class2Record) = _hb_alloc( (count2)*sizeof(HB_Class2Record), &error ), error != 0 ) )
never evaluated: ( (c1r[m].c2r.Class2Record) = _hb_alloc( (count2)*sizeof(HB_Class2Record), &error ), error != 0 )
0
1241 goto Fail1;
never executed: goto Fail1;
0
1242 -
1243 c2r = c1r[m].c2r.Class2Record; -
1244 for ( n = 0; n < count2; n++ )
never evaluated: n < count2
0
1245 { -
1246 if ( format1 )
never evaluated: format1
0
1247 { -
1248 error = Load_ValueRecord( &c2r[n].Value1, format1, -
1249 base_offset, stream ); -
1250 if ( error )
never evaluated: error
0
1251 goto Fail0;
never executed: goto Fail0;
0
1252 }
never executed: }
0
1253 if ( format2 )
never evaluated: format2
0
1254 { -
1255 error = Load_ValueRecord( &c2r[n].Value2, format2, -
1256 base_offset, stream ); -
1257 if ( error )
never evaluated: error
0
1258 { -
1259 if ( format1 )
never evaluated: format1
0
1260 Free_ValueRecord( &c2r[n].Value1, format1 );
never executed: Free_ValueRecord( &c2r[n].Value1, format1 );
0
1261 goto Fail0;
never executed: goto Fail0;
0
1262 } -
1263 }
never executed: }
0
1264 }
never executed: }
0
1265 }
never executed: }
0
1266 -
1267 continue;
executed: continue;
Execution Count:7018
7018
1268 -
1269 Fail0: -
1270 for ( k = 0; k < n; k++ )
never evaluated: k < n
0
1271 { -
1272 if ( format1 )
never evaluated: format1
0
1273 Free_ValueRecord( &c2r[k].Value1, format1 );
never executed: Free_ValueRecord( &c2r[k].Value1, format1 );
0
1274 if ( format2 )
never evaluated: format2
0
1275 Free_ValueRecord( &c2r[k].Value2, format2 );
never executed: Free_ValueRecord( &c2r[k].Value2, format2 );
0
1276 }
never executed: }
0
1277 goto Fail1;
never executed: goto Fail1;
0
1278 } -
1279 -
1280 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:273
273
1281 -
1282Fail1: -
1283 for ( k = 0; k < m; k++ )
never evaluated: k < m
0
1284 { -
1285 if ( !use_flexible_value_records ) {
never evaluated: !use_flexible_value_records
0
1286 c2r = c1r[k].c2r.Class2Record; -
1287 -
1288 for ( n = 0; n < count2; n++ )
never evaluated: n < count2
0
1289 { -
1290 if ( format1 )
never evaluated: format1
0
1291 Free_ValueRecord( &c2r[n].Value1, format1 );
never executed: Free_ValueRecord( &c2r[n].Value1, format1 );
0
1292 if ( format2 )
never evaluated: format2
0
1293 Free_ValueRecord( &c2r[n].Value2, format2 );
never executed: Free_ValueRecord( &c2r[n].Value2, format2 );
0
1294 }
never executed: }
0
1295 -
1296 do { if ( (c2r) ) { _hb_free( c2r ); c2r = ((void *)0); } } while (0);
never evaluated: (c2r)
never evaluated: 0
never executed: }
never executed: }
0
1297 } else {
never executed: }
0
1298 do { if ( (c1r[k].c2r.ValueRecords) ) { _hb_free( c1r[k].c2r.ValueRecords ); c1r[k].c2r.ValueRecords = ((void *)0); } } while (0);
never evaluated: (c1r[k].c2r.ValueRecords)
never evaluated: 0
never executed: }
never executed: }
0
1299 }
never executed: }
0
1300 } -
1301 -
1302 do { if ( (c1r) ) { _hb_free( c1r ); c1r = ((void *)0); } } while (0);
never evaluated: (c1r)
never evaluated: 0
never executed: }
never executed: }
0
1303Fail2:
code before this statement never executed: Fail2:
0
1304 -
1305 _HB_OPEN_Free_ClassDefinition( &ppf2->ClassDef2 ); -
1306 -
1307Fail3:
code before this statement never executed: Fail3:
0
1308 _HB_OPEN_Free_ClassDefinition( &ppf2->ClassDef1 ); -
1309 return error;
never executed: return error;
0
1310} -
1311 -
1312 -
1313static void Free_PairPos2( HB_PairPosFormat2* ppf2, -
1314 HB_UShort format1, -
1315 HB_UShort format2) -
1316{ -
1317 HB_UShort m, n, count1, count2; -
1318 -
1319 HB_Class1Record* c1r; -
1320 HB_Class2Record* c2r; -
1321 -
1322 -
1323 if ( ppf2->Class1Record )
partially evaluated: ppf2->Class1Record
TRUEFALSE
yes
Evaluation Count:261
no
Evaluation Count:0
0-261
1324 { -
1325 c1r = ppf2->Class1Record; -
1326 count1 = ppf2->Class1Count; -
1327 count2 = ppf2->Class2Count; -
1328 -
1329 for ( m = 0; m < count1; m++ )
evaluated: m < count1
TRUEFALSE
yes
Evaluation Count:6670
yes
Evaluation Count:261
261-6670
1330 { -
1331 if ( !c1r[m].IsFlexible ) {
partially evaluated: !c1r[m].IsFlexible
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6670
0-6670
1332 c2r = c1r[m].c2r.Class2Record; -
1333 -
1334 for ( n = 0; n < count2; n++ )
never evaluated: n < count2
0
1335 { -
1336 if ( format1 )
never evaluated: format1
0
1337 Free_ValueRecord( &c2r[n].Value1, format1 );
never executed: Free_ValueRecord( &c2r[n].Value1, format1 );
0
1338 if ( format2 )
never evaluated: format2
0
1339 Free_ValueRecord( &c2r[n].Value2, format2 );
never executed: Free_ValueRecord( &c2r[n].Value2, format2 );
0
1340 }
never executed: }
0
1341 -
1342 do { if ( (c2r) ) { _hb_free( c2r ); c2r = ((void *)0); } } while (0);
never evaluated: (c2r)
never evaluated: 0
never executed: }
never executed: }
0
1343 } else {
never executed: }
0
1344 do { if ( (c1r[m].c2r.ValueRecords) ) { _hb_free( c1r[m].c2r.ValueRecords ); c1r[m].c2r.ValueRecords = ((void *)0); } } while (0);
partially evaluated: (c1r[m].c2r.ValueRecords)
TRUEFALSE
yes
Evaluation Count:6670
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6670
executed: }
Execution Count:6670
executed: }
Execution Count:6670
0-6670
1345 }
executed: }
Execution Count:6670
6670
1346 } -
1347 -
1348 do { if ( (c1r) ) { _hb_free( c1r ); c1r = ((void *)0); } } while (0);
partially evaluated: (c1r)
TRUEFALSE
yes
Evaluation Count:261
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:261
executed: }
Execution Count:261
executed: }
Execution Count:261
0-261
1349 -
1350 _HB_OPEN_Free_ClassDefinition( &ppf2->ClassDef2 ); -
1351 _HB_OPEN_Free_ClassDefinition( &ppf2->ClassDef1 ); -
1352 }
executed: }
Execution Count:261
261
1353}
executed: }
Execution Count:261
261
1354 -
1355 -
1356static HB_Error Load_PairPos( HB_GPOS_SubTable* st, -
1357 HB_Stream stream ) -
1358{ -
1359 HB_Error error; -
1360 HB_PairPos* pp = &st->pair; -
1361 -
1362 HB_UShort format1, format2; -
1363 HB_UInt cur_offset, new_offset, base_offset; -
1364 -
1365 -
1366 base_offset = _hb_stream_pos( stream ); -
1367 -
1368 if ( ( (error = (_hb_stream_frame_enter( stream, 8L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 8L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:276
0-276
1369 return error;
never executed: return error;
0
1370 -
1371 pp->PosFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1372 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
1373 -
1374 format1 = pp->ValueFormat1 = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1375 format2 = pp->ValueFormat2 = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1376 -
1377 _hb_stream_frame_exit( stream ); -
1378 -
1379 cur_offset = _hb_stream_pos( stream ); -
1380 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:276
0-276
1381 ( error = _HB_OPEN_Load_Coverage( &pp->Coverage, stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_Coverage( &pp->Coverage, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:276
0-276
1382 return error;
never executed: return error;
0
1383 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
1384 -
1385 switch ( pp->PosFormat ) -
1386 { -
1387 case 1: -
1388 error = Load_PairPos1( &pp->ppf.ppf1, format1, format2, stream ); -
1389 if ( error )
partially evaluated: error
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
1390 goto Fail;
never executed: goto Fail;
0
1391 break;
executed: break;
Execution Count:3
3
1392 -
1393 case 2: -
1394 error = Load_PairPos2( &pp->ppf.ppf2, format1, format2, stream ); -
1395 if ( error )
partially evaluated: error
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:273
0-273
1396 goto Fail;
never executed: goto Fail;
0
1397 break;
executed: break;
Execution Count:273
273
1398 -
1399 default: -
1400 return _hb_err (HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
1401 } -
1402 -
1403 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:276
276
1404 -
1405Fail: -
1406 _HB_OPEN_Free_Coverage( &pp->Coverage ); -
1407 return error;
never executed: return error;
0
1408} -
1409 -
1410 -
1411static void Free_PairPos( HB_GPOS_SubTable* st ) -
1412{ -
1413 HB_UShort format1, format2; -
1414 HB_PairPos* pp = &st->pair; -
1415 -
1416 -
1417 format1 = pp->ValueFormat1; -
1418 format2 = pp->ValueFormat2; -
1419 -
1420 switch ( pp->PosFormat ) -
1421 { -
1422 case 1: -
1423 Free_PairPos1( &pp->ppf.ppf1, format1, format2 ); -
1424 break;
executed: break;
Execution Count:3
3
1425 -
1426 case 2: -
1427 Free_PairPos2( &pp->ppf.ppf2, format1, format2 ); -
1428 break;
executed: break;
Execution Count:261
261
1429 -
1430 default: -
1431 break;
never executed: break;
0
1432 } -
1433 -
1434 _HB_OPEN_Free_Coverage( &pp->Coverage ); -
1435}
executed: }
Execution Count:264
264
1436 -
1437static HB_Error Lookup_PairPos1( GPOS_Instance* gpi, -
1438 HB_PairPosFormat1* ppf1, -
1439 HB_Buffer buffer, -
1440 HB_UInt first_pos, -
1441 HB_UShort index, -
1442 HB_UShort format1, -
1443 HB_UShort format2 ) -
1444{ -
1445 HB_Error error; -
1446 HB_UShort numpvr, glyph2; -
1447 -
1448 -
1449 -
1450 -
1451 HB_Short *vr; -
1452 HB_UShort second_glyph; -
1453 HB_UInt record_size1, record_size2; -
1454 -
1455 -
1456 if ( index >= ppf1->PairSetCount )
partially evaluated: index >= ppf1->PairSetCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9
0-9
1457 return _hb_err (HB_Err_Invalid_SubTable);
never executed: return _hb_err (HB_Err_Invalid_SubTable);
0
1458 -
1459 if (!ppf1->PairSet[index].PairValueCount)
partially evaluated: !ppf1->PairSet[index].PairValueCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9
0-9
1460 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
1461 -
1462 glyph2 = (buffer->in_string[buffer->in_pos].gindex); -
1463 vr = ppf1->PairSet[index].ValueRecords; -
1464 if ( !vr )
partially evaluated: !vr
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9
0-9
1465 return _hb_err (HB_Err_Invalid_SubTable);
never executed: return _hb_err (HB_Err_Invalid_SubTable);
0
1466 -
1467 record_size1 = Calculate_Class2RecordSize( format1, 0 ); -
1468 record_size2 = Calculate_Class2RecordSize( format2, 0 ); -
1469 -
1470 for ( numpvr = ppf1->PairSet[index].PairValueCount; numpvr; numpvr-- )
evaluated: numpvr
TRUEFALSE
yes
Evaluation Count:71
yes
Evaluation Count:8
8-71
1471 { -
1472 second_glyph = *((HB_UShort *)vr); -
1473 vr++; -
1474 if ( glyph2 == second_glyph )
evaluated: glyph2 == second_glyph
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:70
1-70
1475 { -
1476 error = Get_FlexibleValueRecord( gpi, vr, format1, (&buffer->positions[(first_pos)]) ); -
1477 if ( error )
partially evaluated: error
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1478 return error;
never executed: return error;
0
1479 vr += record_size1; -
1480 -
1481 return Get_FlexibleValueRecord( gpi, vr, format2, (&buffer->positions[(buffer->in_pos)]) );
executed: return Get_FlexibleValueRecord( gpi, vr, format2, (&buffer->positions[(buffer->in_pos)]) );
Execution Count:1
1
1482 } -
1483 else -
1484 { -
1485 vr += record_size1 + record_size2; -
1486 }
executed: }
Execution Count:70
70
1487 } -
1488 -
1489 -
1490 return HB_Err_Not_Covered;
executed: return HB_Err_Not_Covered;
Execution Count:8
8
1491} -
1492 -
1493 -
1494static HB_Error Lookup_PairPos2( GPOS_Instance* gpi, -
1495 HB_PairPosFormat2* ppf2, -
1496 HB_Buffer buffer, -
1497 HB_UInt first_pos, -
1498 HB_UShort format1, -
1499 HB_UShort format2 ) -
1500{ -
1501 HB_Error error; -
1502 HB_UShort cl1 = 0, cl2 = 0; -
1503 -
1504 HB_Class1Record* c1r; -
1505 HB_Class2Record* c2r; -
1506 HB_Short* vr; -
1507 -
1508 HB_UShort vr1_size; -
1509 HB_UShort vr2_size; -
1510 -
1511 -
1512 error = _HB_OPEN_Get_Class( &ppf2->ClassDef1, (buffer->in_string[(first_pos)].gindex), -
1513 &cl1, ((void *)0) ); -
1514 if ( error && error != HB_Err_Not_Covered )
partially evaluated: error
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:433443
never evaluated: error != HB_Err_Not_Covered
0-433443
1515 return error;
never executed: return error;
0
1516 error = _HB_OPEN_Get_Class( &ppf2->ClassDef2, (buffer->in_string[buffer->in_pos].gindex), -
1517 &cl2, ((void *)0) ); -
1518 if ( error && error != HB_Err_Not_Covered )
evaluated: error
TRUEFALSE
yes
Evaluation Count:87680
yes
Evaluation Count:345763
partially evaluated: error != HB_Err_Not_Covered
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:87680
0-345763
1519 return error;
never executed: return error;
0
1520 -
1521 c1r = &ppf2->Class1Record[cl1]; -
1522 if ( !c1r )
partially evaluated: !c1r
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:433443
0-433443
1523 return _hb_err (HB_Err_Invalid_SubTable);
never executed: return _hb_err (HB_Err_Invalid_SubTable);
0
1524 -
1525 if ( !c1r->IsFlexible ) {
partially evaluated: !c1r->IsFlexible
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:433443
0-433443
1526 c2r = &c1r->c2r.Class2Record[cl2]; -
1527 -
1528 error = Get_ValueRecord( gpi, &c2r->Value1, format1, (&buffer->positions[(first_pos)]) ); -
1529 if ( error )
never evaluated: error
0
1530 return error;
never executed: return error;
0
1531 return Get_ValueRecord( gpi, &c2r->Value2, format2, (&buffer->positions[(buffer->in_pos)]) );
never executed: return Get_ValueRecord( gpi, &c2r->Value2, format2, (&buffer->positions[(buffer->in_pos)]) );
0
1532 } else { -
1533 vr1_size = Calculate_Class2RecordSize( format1, 0 ); -
1534 vr2_size = Calculate_Class2RecordSize( format2, 0 ); -
1535 -
1536 vr = c1r->c2r.ValueRecords + (cl2 * ( vr1_size + vr2_size )); -
1537 -
1538 error = Get_FlexibleValueRecord( gpi, vr, format1, (&buffer->positions[(first_pos)]) ); -
1539 if ( error )
partially evaluated: error
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:433443
0-433443
1540 return error;
never executed: return error;
0
1541 vr += vr1_size; -
1542 return Get_FlexibleValueRecord( gpi, vr, format2, (&buffer->positions[(buffer->in_pos)]) );
executed: return Get_FlexibleValueRecord( gpi, vr, format2, (&buffer->positions[(buffer->in_pos)]) );
Execution Count:433443
433443
1543 } -
1544} -
1545 -
1546static HB_Error Lookup_PairPos( GPOS_Instance* gpi, -
1547 HB_GPOS_SubTable* st, -
1548 HB_Buffer buffer, -
1549 HB_UShort flags, -
1550 HB_UShort context_length, -
1551 int nesting_level ) -
1552{ -
1553 HB_Error error; -
1554 HB_UShort index, property; -
1555 HB_UInt first_pos; -
1556 HB_GPOSHeader* gpos = gpi->gpos; -
1557 HB_PairPos* pp = &st->pair; -
1558 -
1559 ((nesting_level) = (nesting_level)); -
1560 -
1561 if ( buffer->in_pos >= buffer->in_length - 1 )
evaluated: buffer->in_pos >= buffer->in_length - 1
TRUEFALSE
yes
Evaluation Count:495854
yes
Evaluation Count:5724511
495854-5724511
1562 return HB_Err_Not_Covered;
executed: return HB_Err_Not_Covered;
Execution Count:495854
495854
1563 -
1564 if ( context_length != 0xFFFF && context_length < 2 )
partially evaluated: context_length != 0xFFFF
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5724511
never evaluated: context_length < 2
0-5724511
1565 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
1566 -
1567 if ( ( ( error = _HB_GDEF_Check_Property( (gpos->gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok ) )
partially evaluated: ( ( error = _HB_GDEF_Check_Property( (gpos->gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5724511
0-5724511
1568 return error;
never executed: return error;
0
1569 -
1570 error = _HB_OPEN_Coverage_Index( &pp->Coverage, (buffer->in_string[buffer->in_pos].gindex), &index ); -
1571 if ( error )
evaluated: error
TRUEFALSE
yes
Evaluation Count:5291059
yes
Evaluation Count:433452
433452-5291059
1572 return error;
executed: return error;
Execution Count:5291059
5291059
1573 -
1574 -
1575 -
1576 first_pos = buffer->in_pos; -
1577 (buffer->in_pos)++; -
1578 -
1579 while ( ( ( error = _HB_GDEF_Check_Property( (gpos->gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok ) )
partially evaluated: ( ( error = _HB_GDEF_Check_Property( (gpos->gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:433452
0-433452
1580 -
1581 { -
1582 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
1583 return error;
never executed: return error;
0
1584 -
1585 if ( buffer->in_pos == buffer->in_length )
never evaluated: buffer->in_pos == buffer->in_length
0
1586 { -
1587 buffer->in_pos = first_pos; -
1588 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
1589 } -
1590 (buffer->in_pos)++; -
1591 -
1592 }
never executed: }
0
1593 -
1594 switch ( pp->PosFormat ) -
1595 { -
1596 case 1: -
1597 error = Lookup_PairPos1( gpi, &pp->ppf.ppf1, buffer, -
1598 first_pos, index, -
1599 pp->ValueFormat1, pp->ValueFormat2 ); -
1600 break;
executed: break;
Execution Count:9
9
1601 -
1602 case 2: -
1603 error = Lookup_PairPos2( gpi, &pp->ppf.ppf2, buffer, first_pos, -
1604 pp->ValueFormat1, pp->ValueFormat2 ); -
1605 break;
executed: break;
Execution Count:433443
433443
1606 -
1607 default: -
1608 return _hb_err (HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
1609 } -
1610 -
1611 -
1612 -
1613 -
1614 if ( error == HB_Err_Not_Covered )
evaluated: error == HB_Err_Not_Covered
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:433444
8-433444
1615 buffer->in_pos = first_pos;
executed: buffer->in_pos = first_pos;
Execution Count:8
8
1616 -
1617 -
1618 -
1619 if ( pp->ValueFormat2 )
partially evaluated: pp->ValueFormat2
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:433452
0-433452
1620 (buffer->in_pos)++;
never executed: (buffer->in_pos)++;
0
1621 -
1622 return error;
executed: return error;
Execution Count:433452
433452
1623} -
1624 -
1625 -
1626 -
1627 -
1628 -
1629 -
1630static HB_Error Load_CursivePos( HB_GPOS_SubTable* st, -
1631 HB_Stream stream ) -
1632{ -
1633 HB_Error error; -
1634 HB_CursivePos* cp = &st->cursive; -
1635 -
1636 HB_UShort n, m, count; -
1637 HB_UInt cur_offset, new_offset, base_offset; -
1638 -
1639 HB_EntryExitRecord* eer; -
1640 -
1641 -
1642 base_offset = _hb_stream_pos( stream ); -
1643 -
1644 if ( ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
0
1645 return error;
never executed: return error;
0
1646 -
1647 cp->PosFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1648 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
1649 -
1650 _hb_stream_frame_exit( stream ); -
1651 -
1652 cur_offset = _hb_stream_pos( stream ); -
1653 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
1654 ( error = _HB_OPEN_Load_Coverage( &cp->Coverage, stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Coverage( &cp->Coverage, stream ) ) != HB_Err_Ok
0
1655 return error;
never executed: return error;
0
1656 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
1657 -
1658 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
1659 goto Fail2;
never executed: goto Fail2;
0
1660 -
1661 count = cp->EntryExitCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1662 -
1663 _hb_stream_frame_exit( stream ); -
1664 -
1665 cp->EntryExitRecord = ((void *)0); -
1666 -
1667 if ( ( (cp->EntryExitRecord) = _hb_alloc( (count)*sizeof(HB_EntryExitRecord), &error ), error != 0 ) )
never evaluated: ( (cp->EntryExitRecord) = _hb_alloc( (count)*sizeof(HB_EntryExitRecord), &error ), error != 0 )
0
1668 goto Fail2;
never executed: goto Fail2;
0
1669 -
1670 eer = cp->EntryExitRecord; -
1671 -
1672 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1673 { -
1674 HB_UInt entry_offset; -
1675 -
1676 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
1677 return error;
never executed: return error;
0
1678 -
1679 entry_offset = new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1680 -
1681 _hb_stream_frame_exit( stream ); -
1682 -
1683 if ( new_offset )
never evaluated: new_offset
0
1684 { -
1685 new_offset += base_offset; -
1686 -
1687 cur_offset = _hb_stream_pos( stream ); -
1688 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
1689 ( error = Load_Anchor( &eer[n].EntryAnchor, 0
1690 stream ) ) != HB_Err_Ok )
never evaluated: ( error = Load_Anchor( &eer[n].EntryAnchor, stream ) ) != HB_Err_Ok
0
1691 goto Fail1;
never executed: goto Fail1;
0
1692 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
1693 }
never executed: }
0
1694 else -
1695 eer[n].EntryAnchor.PosFormat = 0;
never executed: eer[n].EntryAnchor.PosFormat = 0;
0
1696 -
1697 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
1698 return error;
never executed: return error;
0
1699 -
1700 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1701 -
1702 _hb_stream_frame_exit( stream ); -
1703 -
1704 if ( new_offset )
never evaluated: new_offset
0
1705 { -
1706 new_offset += base_offset; -
1707 -
1708 cur_offset = _hb_stream_pos( stream ); -
1709 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
1710 ( error = Load_Anchor( &eer[n].ExitAnchor, 0
1711 stream ) ) != HB_Err_Ok )
never evaluated: ( error = Load_Anchor( &eer[n].ExitAnchor, stream ) ) != HB_Err_Ok
0
1712 { -
1713 if ( entry_offset )
never evaluated: entry_offset
0
1714 Free_Anchor( &eer[n].EntryAnchor );
never executed: Free_Anchor( &eer[n].EntryAnchor );
0
1715 goto Fail1;
never executed: goto Fail1;
0
1716 } -
1717 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
1718 }
never executed: }
0
1719 else -
1720 eer[n].ExitAnchor.PosFormat = 0;
never executed: eer[n].ExitAnchor.PosFormat = 0;
0
1721 } -
1722 -
1723 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1724 -
1725Fail1: -
1726 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
1727 { -
1728 Free_Anchor( &eer[m].EntryAnchor ); -
1729 Free_Anchor( &eer[m].ExitAnchor ); -
1730 }
never executed: }
0
1731 -
1732 do { if ( (eer) ) { _hb_free( eer ); eer = ((void *)0); } } while (0);
never evaluated: (eer)
never evaluated: 0
never executed: }
never executed: }
0
1733 -
1734Fail2:
code before this statement never executed: Fail2:
0
1735 _HB_OPEN_Free_Coverage( &cp->Coverage ); -
1736 return error;
never executed: return error;
0
1737} -
1738 -
1739 -
1740static void Free_CursivePos( HB_GPOS_SubTable* st ) -
1741{ -
1742 HB_UShort n, count; -
1743 HB_CursivePos* cp = &st->cursive; -
1744 -
1745 HB_EntryExitRecord* eer; -
1746 -
1747 -
1748 if ( cp->EntryExitRecord )
never evaluated: cp->EntryExitRecord
0
1749 { -
1750 count = cp->EntryExitCount; -
1751 eer = cp->EntryExitRecord; -
1752 -
1753 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1754 { -
1755 Free_Anchor( &eer[n].EntryAnchor ); -
1756 Free_Anchor( &eer[n].ExitAnchor ); -
1757 }
never executed: }
0
1758 -
1759 do { if ( (eer) ) { _hb_free( eer ); eer = ((void *)0); } } while (0);
never evaluated: (eer)
never evaluated: 0
never executed: }
never executed: }
0
1760 }
never executed: }
0
1761 -
1762 _HB_OPEN_Free_Coverage( &cp->Coverage ); -
1763}
never executed: }
0
1764 -
1765 -
1766static HB_Error Lookup_CursivePos( GPOS_Instance* gpi, -
1767 HB_GPOS_SubTable* st, -
1768 HB_Buffer buffer, -
1769 HB_UShort flags, -
1770 HB_UShort context_length, -
1771 int nesting_level ) -
1772{ -
1773 HB_UShort index, property; -
1774 HB_Error error; -
1775 HB_GPOSHeader* gpos = gpi->gpos; -
1776 HB_CursivePos* cp = &st->cursive; -
1777 -
1778 HB_EntryExitRecord* eer; -
1779 HB_Fixed entry_x, entry_y; -
1780 HB_Fixed exit_x, exit_y; -
1781 -
1782 ((nesting_level) = (nesting_level)); -
1783 -
1784 if ( context_length != 0xFFFF && context_length < 1 )
never evaluated: context_length != 0xFFFF
never evaluated: context_length < 1
0
1785 { -
1786 gpi->last = 0xFFFF; -
1787 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
1788 } -
1789 -
1790 -
1791 -
1792 -
1793 if ( ( ( error = _HB_GDEF_Check_Property( (gpos->gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gpos->gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
0
1794 return error;
never executed: return error;
0
1795 -
1796 -
1797 -
1798 -
1799 if ( property == 0x0008 )
never evaluated: property == 0x0008
0
1800 { -
1801 gpi->last = 0xFFFF; -
1802 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
1803 } -
1804 -
1805 error = _HB_OPEN_Coverage_Index( &cp->Coverage, (buffer->in_string[buffer->in_pos].gindex), &index ); -
1806 if ( error )
never evaluated: error
0
1807 { -
1808 gpi->last = 0xFFFF; -
1809 return error;
never executed: return error;
0
1810 } -
1811 -
1812 if ( index >= cp->EntryExitCount )
never evaluated: index >= cp->EntryExitCount
0
1813 return _hb_err (HB_Err_Invalid_SubTable);
never executed: return _hb_err (HB_Err_Invalid_SubTable);
0
1814 -
1815 eer = &cp->EntryExitRecord[index]; -
1816 if ( gpi->last == 0xFFFF )
never evaluated: gpi->last == 0xFFFF
0
1817 goto end;
never executed: goto end;
0
1818 -
1819 -
1820 -
1821 -
1822 error = Get_Anchor( gpi, &eer->EntryAnchor, (buffer->in_string[buffer->in_pos].gindex), -
1823 &entry_x, &entry_y ); -
1824 if ( error == HB_Err_Not_Covered )
never evaluated: error == HB_Err_Not_Covered
0
1825 goto end;
never executed: goto end;
0
1826 if ( error )
never evaluated: error
0
1827 return error;
never executed: return error;
0
1828 -
1829 if ( gpi->r2l )
never evaluated: gpi->r2l
0
1830 { -
1831 (&buffer->positions[(buffer->in_pos)])->x_advance = entry_x - gpi->anchor_x; -
1832 (&buffer->positions[(buffer->in_pos)])->new_advance = (!0); -
1833 }
never executed: }
0
1834 else -
1835 { -
1836 (&buffer->positions[(gpi->last)])->x_advance = gpi->anchor_x - entry_x; -
1837 (&buffer->positions[(gpi->last)])->new_advance = (!0); -
1838 }
never executed: }
0
1839 -
1840 if ( flags & 0x0001 )
never evaluated: flags & 0x0001
0
1841 { -
1842 (&buffer->positions[(gpi->last)])->cursive_chain = gpi->last - buffer->in_pos; -
1843 (&buffer->positions[(gpi->last)])->y_pos = entry_y - gpi->anchor_y; -
1844 }
never executed: }
0
1845 else -
1846 { -
1847 (&buffer->positions[(buffer->in_pos)])->cursive_chain = buffer->in_pos - gpi->last; -
1848 (&buffer->positions[(buffer->in_pos)])->y_pos = gpi->anchor_y - entry_y; -
1849 }
never executed: }
0
1850 -
1851end:
code before this statement never executed: end:
0
1852 error = Get_Anchor( gpi, &eer->ExitAnchor, (buffer->in_string[buffer->in_pos].gindex), -
1853 &exit_x, &exit_y ); -
1854 if ( error == HB_Err_Not_Covered )
never evaluated: error == HB_Err_Not_Covered
0
1855 gpi->last = 0xFFFF;
never executed: gpi->last = 0xFFFF;
0
1856 else -
1857 { -
1858 gpi->last = buffer->in_pos; -
1859 gpi->anchor_x = exit_x; -
1860 gpi->anchor_y = exit_y; -
1861 }
never executed: }
0
1862 if ( error )
never evaluated: error
0
1863 return error;
never executed: return error;
0
1864 -
1865 (buffer->in_pos)++; -
1866 -
1867 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1868} -
1869 -
1870 -
1871 -
1872 -
1873 -
1874 -
1875static HB_Error Load_BaseArray( HB_BaseArray* ba, -
1876 HB_UShort num_classes, -
1877 HB_Stream stream ) -
1878{ -
1879 HB_Error error; -
1880 -
1881 HB_UShort m, n, count; -
1882 HB_UInt cur_offset, new_offset, base_offset; -
1883 -
1884 HB_BaseRecord *br; -
1885 HB_Anchor *ban, *bans; -
1886 -
1887 -
1888 base_offset = _hb_stream_pos( stream ); -
1889 -
1890 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1298
0-1298
1891 return error;
never executed: return error;
0
1892 -
1893 count = ba->BaseCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1894 -
1895 _hb_stream_frame_exit( stream ); -
1896 -
1897 ba->BaseRecord = ((void *)0); -
1898 -
1899 if ( ( (ba->BaseRecord) = _hb_alloc( (count)*sizeof(HB_BaseRecord), &error ), error != 0 ) )
partially evaluated: ( (ba->BaseRecord) = _hb_alloc( (count)*sizeof(HB_BaseRecord), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1298
0-1298
1900 return error;
never executed: return error;
0
1901 -
1902 br = ba->BaseRecord; -
1903 -
1904 bans = ((void *)0); -
1905 -
1906 if ( ( (bans) = _hb_alloc( (count * num_classes)*sizeof(HB_Anchor), &error ), error != 0 ) )
partially evaluated: ( (bans) = _hb_alloc( (count * num_classes)*sizeof(HB_Anchor), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1298
0-1298
1907 goto Fail;
never executed: goto Fail;
0
1908 -
1909 for ( m = 0; m < count; m++ )
evaluated: m < count
TRUEFALSE
yes
Evaluation Count:305405
yes
Evaluation Count:1298
1298-305405
1910 { -
1911 br[m].BaseAnchor = ((void *)0); -
1912 -
1913 ban = br[m].BaseAnchor = bans + m * num_classes; -
1914 -
1915 for ( n = 0; n < num_classes; n++ )
evaluated: n < num_classes
TRUEFALSE
yes
Evaluation Count:311919
yes
Evaluation Count:305405
305405-311919
1916 { -
1917 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:311919
0-311919
1918 goto Fail;
never executed: goto Fail;
0
1919 -
1920 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
1921 -
1922 _hb_stream_frame_exit( stream ); -
1923 -
1924 if (new_offset == base_offset) {
evaluated: new_offset == base_offset
TRUEFALSE
yes
Evaluation Count:4110
yes
Evaluation Count:307809
4110-307809
1925 -
1926 -
1927 -
1928 -
1929 ban[n].PosFormat = 0; -
1930 continue;
executed: continue;
Execution Count:4110
4110
1931 } -
1932 -
1933 cur_offset = _hb_stream_pos( stream ); -
1934 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:307809
0-307809
1935 ( error = Load_Anchor( &ban[n], stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_Anchor( &ban[n], stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:307809
0-307809
1936 goto Fail;
never executed: goto Fail;
0
1937 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
1938 }
executed: }
Execution Count:307809
307809
1939 }
executed: }
Execution Count:305405
305405
1940 -
1941 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:1298
1298
1942 -
1943Fail: -
1944 do { if ( (bans) ) { _hb_free( bans ); bans = ((void *)0); } } while (0);
never evaluated: (bans)
never evaluated: 0
never executed: }
never executed: }
0
1945 do { if ( (br) ) { _hb_free( br ); br = ((void *)0); } } while (0);
never evaluated: (br)
never evaluated: 0
never executed: }
never executed: }
0
1946 return error;
never executed: return error;
0
1947} -
1948 -
1949 -
1950static void Free_BaseArray( HB_BaseArray* ba, -
1951 HB_UShort num_classes ) -
1952{ -
1953 HB_BaseRecord *br; -
1954 HB_Anchor *bans; -
1955 -
1956 if ( ba->BaseRecord )
partially evaluated: ba->BaseRecord
TRUEFALSE
yes
Evaluation Count:1233
no
Evaluation Count:0
0-1233
1957 { -
1958 br = ba->BaseRecord; -
1959 -
1960 if ( ba->BaseCount )
partially evaluated: ba->BaseCount
TRUEFALSE
yes
Evaluation Count:1233
no
Evaluation Count:0
0-1233
1961 { -
1962 HB_UShort i, count; -
1963 count = num_classes * ba->BaseCount; -
1964 bans = br[0].BaseAnchor; -
1965 for (i = 0; i < count; i++)
evaluated: i < count
TRUEFALSE
yes
Evaluation Count:295524
yes
Evaluation Count:1233
1233-295524
1966 Free_Anchor (&bans[i]);
executed: Free_Anchor (&bans[i]);
Execution Count:295524
295524
1967 do { if ( (bans) ) { _hb_free( bans ); bans = ((void *)0); } } while (0);
partially evaluated: (bans)
TRUEFALSE
yes
Evaluation Count:1233
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1233
executed: }
Execution Count:1233
executed: }
Execution Count:1233
0-1233
1968 }
executed: }
Execution Count:1233
1233
1969 -
1970 do { if ( (br) ) { _hb_free( br ); br = ((void *)0); } } while (0);
partially evaluated: (br)
TRUEFALSE
yes
Evaluation Count:1233
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1233
executed: }
Execution Count:1233
executed: }
Execution Count:1233
0-1233
1971 }
executed: }
Execution Count:1233
1233
1972}
executed: }
Execution Count:1233
1233
1973 -
1974 -
1975 -
1976 -
1977static HB_Error Load_MarkBasePos( HB_GPOS_SubTable* st, -
1978 HB_Stream stream ) -
1979{ -
1980 HB_Error error; -
1981 HB_MarkBasePos* mbp = &st->markbase; -
1982 -
1983 HB_UInt cur_offset, new_offset, base_offset; -
1984 -
1985 -
1986 base_offset = _hb_stream_pos( stream ); -
1987 -
1988 if ( ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1298
0-1298
1989 return error;
never executed: return error;
0
1990 -
1991 mbp->PosFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1992 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
1993 -
1994 _hb_stream_frame_exit( stream ); -
1995 -
1996 if (mbp->PosFormat != 1)
partially evaluated: mbp->PosFormat != 1
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1298
0-1298
1997 return _hb_err (HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
1998 -
1999 cur_offset = _hb_stream_pos( stream ); -
2000 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1298
0-1298
2001 ( error = _HB_OPEN_Load_Coverage( &mbp->MarkCoverage, stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_Coverage( &mbp->MarkCoverage, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1298
0-1298
2002 return error;
never executed: return error;
0
2003 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
2004 -
2005 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1298
0-1298
2006 goto Fail3;
never executed: goto Fail3;
0
2007 -
2008 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
2009 -
2010 _hb_stream_frame_exit( stream ); -
2011 -
2012 cur_offset = _hb_stream_pos( stream ); -
2013 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1298
0-1298
2014 ( error = _HB_OPEN_Load_Coverage( &mbp->BaseCoverage, stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_Coverage( &mbp->BaseCoverage, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1298
0-1298
2015 goto Fail3;
never executed: goto Fail3;
0
2016 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
2017 -
2018 if ( ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1298
0-1298
2019 goto Fail2;
never executed: goto Fail2;
0
2020 -
2021 mbp->ClassCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2022 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
2023 -
2024 _hb_stream_frame_exit( stream ); -
2025 -
2026 cur_offset = _hb_stream_pos( stream ); -
2027 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1298
0-1298
2028 ( error = Load_MarkArray( &mbp->MarkArray, stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_MarkArray( &mbp->MarkArray, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1298
0-1298
2029 goto Fail2;
never executed: goto Fail2;
0
2030 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
2031 -
2032 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1298
0-1298
2033 goto Fail1;
never executed: goto Fail1;
0
2034 -
2035 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
2036 -
2037 _hb_stream_frame_exit( stream ); -
2038 -
2039 cur_offset = _hb_stream_pos( stream ); -
2040 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1298
0-1298
2041 ( error = Load_BaseArray( &mbp->BaseArray, mbp->ClassCount, 0-1298
2042 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_BaseArray( &mbp->BaseArray, mbp->ClassCount, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1298
0-1298
2043 goto Fail1;
never executed: goto Fail1;
0
2044 -
2045 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:1298
1298
2046 -
2047Fail1: -
2048 Free_MarkArray( &mbp->MarkArray ); -
2049 -
2050Fail2:
code before this statement never executed: Fail2:
0
2051 _HB_OPEN_Free_Coverage( &mbp->BaseCoverage ); -
2052 -
2053Fail3:
code before this statement never executed: Fail3:
0
2054 _HB_OPEN_Free_Coverage( &mbp->MarkCoverage ); -
2055 return error;
never executed: return error;
0
2056} -
2057 -
2058 -
2059static void Free_MarkBasePos( HB_GPOS_SubTable* st ) -
2060{ -
2061 HB_MarkBasePos* mbp = &st->markbase; -
2062 -
2063 Free_BaseArray( &mbp->BaseArray, mbp->ClassCount ); -
2064 Free_MarkArray( &mbp->MarkArray ); -
2065 _HB_OPEN_Free_Coverage( &mbp->BaseCoverage ); -
2066 _HB_OPEN_Free_Coverage( &mbp->MarkCoverage ); -
2067}
executed: }
Execution Count:1233
1233
2068 -
2069 -
2070static HB_Error Lookup_MarkBasePos( GPOS_Instance* gpi, -
2071 HB_GPOS_SubTable* st, -
2072 HB_Buffer buffer, -
2073 HB_UShort flags, -
2074 HB_UShort context_length, -
2075 int nesting_level ) -
2076{ -
2077 HB_UShort i, j, mark_index, base_index, property, class; -
2078 HB_Fixed x_mark_value, y_mark_value, x_base_value, y_base_value; -
2079 HB_Error error; -
2080 HB_GPOSHeader* gpos = gpi->gpos; -
2081 HB_MarkBasePos* mbp = &st->markbase; -
2082 -
2083 HB_MarkArray* ma; -
2084 HB_BaseArray* ba; -
2085 HB_BaseRecord* br; -
2086 HB_Anchor* mark_anchor; -
2087 HB_Anchor* base_anchor; -
2088 -
2089 HB_Position o; -
2090 -
2091 ((nesting_level) = (nesting_level)); -
2092 -
2093 if ( context_length != 0xFFFF && context_length < 1 )
partially evaluated: context_length != 0xFFFF
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16167399
never evaluated: context_length < 1
0-16167399
2094 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
2095 -
2096 if ( flags & 0x0002 )
partially evaluated: flags & 0x0002
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16167399
0-16167399
2097 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
2098 -
2099 if ( ( ( error = _HB_GDEF_Check_Property( (gpos->gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok ) )
evaluated: ( ( error = _HB_GDEF_Check_Property( (gpos->gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
TRUEFALSE
yes
Evaluation Count:49510
yes
Evaluation Count:16117889
49510-16117889
2100 -
2101 return error;
executed: return error;
Execution Count:49510
49510
2102 -
2103 error = _HB_OPEN_Coverage_Index( &mbp->MarkCoverage, (buffer->in_string[buffer->in_pos].gindex), -
2104 &mark_index ); -
2105 if ( error )
evaluated: error
TRUEFALSE
yes
Evaluation Count:15912905
yes
Evaluation Count:204984
204984-15912905
2106 return error;
executed: return error;
Execution Count:15912905
15912905
2107 -
2108 -
2109 -
2110 i = 1; -
2111 j = buffer->in_pos - 1; -
2112 -
2113 while ( i <= buffer->in_pos )
partially evaluated: i <= buffer->in_pos
TRUEFALSE
yes
Evaluation Count:205024
no
Evaluation Count:0
0-205024
2114 { -
2115 error = HB_GDEF_Get_Glyph_Property( gpos->gdef, (buffer->in_string[(j)].gindex), -
2116 &property ); -
2117 if ( error )
partially evaluated: error
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:205024
0-205024
2118 return error;
never executed: return error;
0
2119 -
2120 if ( !( property == 0x0008 || property & 0xFF00 ) )
evaluated: property == 0x0008
TRUEFALSE
yes
Evaluation Count:40
yes
Evaluation Count:204984
partially evaluated: property & 0xFF00
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:204984
0-204984
2121 break;
executed: break;
Execution Count:204984
204984
2122 -
2123 i++; -
2124 j--; -
2125 }
executed: }
Execution Count:40
40
2126 -
2127 -
2128 -
2129 -
2130 -
2131 -
2132 -
2133 if ( i > buffer->in_pos )
partially evaluated: i > buffer->in_pos
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:204984
0-204984
2134 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
2135 -
2136 error = _HB_OPEN_Coverage_Index( &mbp->BaseCoverage, (buffer->in_string[(j)].gindex), -
2137 &base_index ); -
2138 if ( error )
evaluated: error
TRUEFALSE
yes
Evaluation Count:203776
yes
Evaluation Count:1208
1208-203776
2139 return error;
executed: return error;
Execution Count:203776
203776
2140 -
2141 ma = &mbp->MarkArray; -
2142 -
2143 if ( mark_index >= ma->MarkCount )
partially evaluated: mark_index >= ma->MarkCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1208
0-1208
2144 return _hb_err (HB_Err_Invalid_SubTable);
never executed: return _hb_err (HB_Err_Invalid_SubTable);
0
2145 -
2146 class = ma->MarkRecord[mark_index].Class; -
2147 mark_anchor = &ma->MarkRecord[mark_index].MarkAnchor; -
2148 -
2149 if ( class >= mbp->ClassCount )
partially evaluated: class >= mbp->ClassCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1208
0-1208
2150 return _hb_err (HB_Err_Invalid_SubTable);
never executed: return _hb_err (HB_Err_Invalid_SubTable);
0
2151 -
2152 ba = &mbp->BaseArray; -
2153 -
2154 if ( base_index >= ba->BaseCount )
partially evaluated: base_index >= ba->BaseCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1208
0-1208
2155 return _hb_err (HB_Err_Invalid_SubTable);
never executed: return _hb_err (HB_Err_Invalid_SubTable);
0
2156 -
2157 br = &ba->BaseRecord[base_index]; -
2158 base_anchor = &br->BaseAnchor[class]; -
2159 -
2160 error = Get_Anchor( gpi, mark_anchor, (buffer->in_string[buffer->in_pos].gindex), -
2161 &x_mark_value, &y_mark_value ); -
2162 if ( error )
partially evaluated: error
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1208
0-1208
2163 return error;
never executed: return error;
0
2164 -
2165 error = Get_Anchor( gpi, base_anchor, (buffer->in_string[(j)].gindex), -
2166 &x_base_value, &y_base_value ); -
2167 if ( error )
partially evaluated: error
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1208
0-1208
2168 return error;
never executed: return error;
0
2169 -
2170 -
2171 -
2172 o = (&buffer->positions[(buffer->in_pos)]); -
2173 -
2174 o->x_pos = x_base_value - x_mark_value; -
2175 o->y_pos = y_base_value - y_mark_value; -
2176 o->x_advance = 0; -
2177 o->y_advance = 0; -
2178 o->back = i; -
2179 -
2180 (buffer->in_pos)++; -
2181 -
2182 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:1208
1208
2183} -
2184 -
2185 -
2186 -
2187 -
2188 -
2189 -
2190static HB_Error Load_LigatureAttach( HB_LigatureAttach* lat, -
2191 HB_UShort num_classes, -
2192 HB_Stream stream ) -
2193{ -
2194 HB_Error error; -
2195 -
2196 HB_UShort m, n, k, count; -
2197 HB_UInt cur_offset, new_offset, base_offset; -
2198 -
2199 HB_ComponentRecord* cr; -
2200 HB_Anchor* lan; -
2201 -
2202 -
2203 base_offset = _hb_stream_pos( stream ); -
2204 -
2205 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2107
0-2107
2206 return error;
never executed: return error;
0
2207 -
2208 count = lat->ComponentCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2209 -
2210 _hb_stream_frame_exit( stream ); -
2211 -
2212 lat->ComponentRecord = ((void *)0); -
2213 -
2214 if ( ( (lat->ComponentRecord) = _hb_alloc( (count)*sizeof(HB_ComponentRecord), &error ), error != 0 ) )
partially evaluated: ( (lat->ComponentRecord) = _hb_alloc( (count)*sizeof(HB_ComponentRecord), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2107
0-2107
2215 return error;
never executed: return error;
0
2216 -
2217 cr = lat->ComponentRecord; -
2218 -
2219 for ( m = 0; m < count; m++ )
evaluated: m < count
TRUEFALSE
yes
Evaluation Count:4123
yes
Evaluation Count:2107
2107-4123
2220 { -
2221 cr[m].LigatureAnchor = ((void *)0); -
2222 -
2223 if ( ( (cr[m].LigatureAnchor) = _hb_alloc( (num_classes)*sizeof(HB_Anchor), &error ), error != 0 ) )
partially evaluated: ( (cr[m].LigatureAnchor) = _hb_alloc( (num_classes)*sizeof(HB_Anchor), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4123
0-4123
2224 goto Fail;
never executed: goto Fail;
0
2225 -
2226 lan = cr[m].LigatureAnchor; -
2227 -
2228 for ( n = 0; n < num_classes; n++ )
evaluated: n < num_classes
TRUEFALSE
yes
Evaluation Count:4123
yes
Evaluation Count:4123
4123
2229 { -
2230 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4123
0-4123
2231 goto Fail0;
never executed: goto Fail0;
0
2232 -
2233 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2234 -
2235 _hb_stream_frame_exit( stream ); -
2236 -
2237 if ( new_offset )
partially evaluated: new_offset
TRUEFALSE
yes
Evaluation Count:4123
no
Evaluation Count:0
0-4123
2238 { -
2239 new_offset += base_offset; -
2240 -
2241 cur_offset = _hb_stream_pos( stream ); -
2242 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4123
0-4123
2243 ( error = Load_Anchor( &lan[n], stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_Anchor( &lan[n], stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4123
0-4123
2244 goto Fail0;
never executed: goto Fail0;
0
2245 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
2246 }
executed: }
Execution Count:4123
4123
2247 else -
2248 lan[n].PosFormat = 0;
never executed: lan[n].PosFormat = 0;
0
2249 } -
2250 -
2251 continue;
executed: continue;
Execution Count:4123
4123
2252 Fail0: -
2253 for ( k = 0; k < n; k++ )
never evaluated: k < n
0
2254 Free_Anchor( &lan[k] );
never executed: Free_Anchor( &lan[k] );
0
2255 goto Fail;
never executed: goto Fail;
0
2256 } -
2257 -
2258 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:2107
2107
2259 -
2260Fail: -
2261 for ( k = 0; k < m; k++ )
never evaluated: k < m
0
2262 { -
2263 lan = cr[k].LigatureAnchor; -
2264 -
2265 for ( n = 0; n < num_classes; n++ )
never evaluated: n < num_classes
0
2266 Free_Anchor( &lan[n] );
never executed: Free_Anchor( &lan[n] );
0
2267 -
2268 do { if ( (lan) ) { _hb_free( lan ); lan = ((void *)0); } } while (0);
never evaluated: (lan)
never evaluated: 0
never executed: }
never executed: }
0
2269 }
never executed: }
0
2270 -
2271 do { if ( (cr) ) { _hb_free( cr ); cr = ((void *)0); } } while (0);
never evaluated: (cr)
never evaluated: 0
never executed: }
never executed: }
0
2272 return error;
never executed: return error;
0
2273} -
2274 -
2275 -
2276static void Free_LigatureAttach( HB_LigatureAttach* lat, -
2277 HB_UShort num_classes ) -
2278{ -
2279 HB_UShort m, n, count; -
2280 -
2281 HB_ComponentRecord* cr; -
2282 HB_Anchor* lan; -
2283 -
2284 -
2285 if ( lat->ComponentRecord )
partially evaluated: lat->ComponentRecord
TRUEFALSE
yes
Evaluation Count:1989
no
Evaluation Count:0
0-1989
2286 { -
2287 count = lat->ComponentCount; -
2288 cr = lat->ComponentRecord; -
2289 -
2290 for ( m = 0; m < count; m++ )
evaluated: m < count
TRUEFALSE
yes
Evaluation Count:3893
yes
Evaluation Count:1989
1989-3893
2291 { -
2292 lan = cr[m].LigatureAnchor; -
2293 -
2294 for ( n = 0; n < num_classes; n++ )
evaluated: n < num_classes
TRUEFALSE
yes
Evaluation Count:3893
yes
Evaluation Count:3893
3893
2295 Free_Anchor( &lan[n] );
executed: Free_Anchor( &lan[n] );
Execution Count:3893
3893
2296 -
2297 do { if ( (lan) ) { _hb_free( lan ); lan = ((void *)0); } } while (0);
partially evaluated: (lan)
TRUEFALSE
yes
Evaluation Count:3893
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3893
executed: }
Execution Count:3893
executed: }
Execution Count:3893
0-3893
2298 }
executed: }
Execution Count:3893
3893
2299 -
2300 do { if ( (cr) ) { _hb_free( cr ); cr = ((void *)0); } } while (0);
partially evaluated: (cr)
TRUEFALSE
yes
Evaluation Count:1989
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1989
executed: }
Execution Count:1989
executed: }
Execution Count:1989
0-1989
2301 }
executed: }
Execution Count:1989
1989
2302}
executed: }
Execution Count:1989
1989
2303 -
2304 -
2305 -
2306 -
2307static HB_Error Load_LigatureArray( HB_LigatureArray* la, -
2308 HB_UShort num_classes, -
2309 HB_Stream stream ) -
2310{ -
2311 HB_Error error; -
2312 -
2313 HB_UShort n, m, count; -
2314 HB_UInt cur_offset, new_offset, base_offset; -
2315 -
2316 HB_LigatureAttach* lat; -
2317 -
2318 -
2319 base_offset = _hb_stream_pos( stream ); -
2320 -
2321 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:343
0-343
2322 return error;
never executed: return error;
0
2323 -
2324 count = la->LigatureCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2325 -
2326 _hb_stream_frame_exit( stream ); -
2327 -
2328 la->LigatureAttach = ((void *)0); -
2329 -
2330 if ( ( (la->LigatureAttach) = _hb_alloc( (count)*sizeof(HB_LigatureAttach), &error ), error != 0 ) )
partially evaluated: ( (la->LigatureAttach) = _hb_alloc( (count)*sizeof(HB_LigatureAttach), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:343
0-343
2331 return error;
never executed: return error;
0
2332 -
2333 lat = la->LigatureAttach; -
2334 -
2335 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:2107
yes
Evaluation Count:343
343-2107
2336 { -
2337 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2107
0-2107
2338 goto Fail;
never executed: goto Fail;
0
2339 -
2340 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
2341 -
2342 _hb_stream_frame_exit( stream ); -
2343 -
2344 cur_offset = _hb_stream_pos( stream ); -
2345 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2107
0-2107
2346 ( error = Load_LigatureAttach( &lat[n], num_classes, 0-2107
2347 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_LigatureAttach( &lat[n], num_classes, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2107
0-2107
2348 goto Fail;
never executed: goto Fail;
0
2349 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
2350 }
executed: }
Execution Count:2107
2107
2351 -
2352 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:343
343
2353 -
2354Fail: -
2355 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
2356 Free_LigatureAttach( &lat[m], num_classes );
never executed: Free_LigatureAttach( &lat[m], num_classes );
0
2357 -
2358 do { if ( (lat) ) { _hb_free( lat ); lat = ((void *)0); } } while (0);
never evaluated: (lat)
never evaluated: 0
never executed: }
never executed: }
0
2359 return error;
never executed: return error;
0
2360} -
2361 -
2362 -
2363static void Free_LigatureArray( HB_LigatureArray* la, -
2364 HB_UShort num_classes ) -
2365{ -
2366 HB_UShort n, count; -
2367 -
2368 HB_LigatureAttach* lat; -
2369 -
2370 -
2371 if ( la->LigatureAttach )
partially evaluated: la->LigatureAttach
TRUEFALSE
yes
Evaluation Count:323
no
Evaluation Count:0
0-323
2372 { -
2373 count = la->LigatureCount; -
2374 lat = la->LigatureAttach; -
2375 -
2376 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:1989
yes
Evaluation Count:323
323-1989
2377 Free_LigatureAttach( &lat[n], num_classes );
executed: Free_LigatureAttach( &lat[n], num_classes );
Execution Count:1989
1989
2378 -
2379 do { if ( (lat) ) { _hb_free( lat ); lat = ((void *)0); } } while (0);
partially evaluated: (lat)
TRUEFALSE
yes
Evaluation Count:323
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:323
executed: }
Execution Count:323
executed: }
Execution Count:323
0-323
2380 }
executed: }
Execution Count:323
323
2381}
executed: }
Execution Count:323
323
2382 -
2383 -
2384 -
2385 -
2386static HB_Error Load_MarkLigPos( HB_GPOS_SubTable* st, -
2387 HB_Stream stream ) -
2388{ -
2389 HB_Error error; -
2390 HB_MarkLigPos* mlp = &st->marklig; -
2391 -
2392 HB_UInt cur_offset, new_offset, base_offset; -
2393 -
2394 -
2395 base_offset = _hb_stream_pos( stream ); -
2396 -
2397 if ( ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:343
0-343
2398 return error;
never executed: return error;
0
2399 -
2400 mlp->PosFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2401 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
2402 -
2403 _hb_stream_frame_exit( stream ); -
2404 -
2405 cur_offset = _hb_stream_pos( stream ); -
2406 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:343
0-343
2407 ( error = _HB_OPEN_Load_Coverage( &mlp->MarkCoverage, stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_Coverage( &mlp->MarkCoverage, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:343
0-343
2408 return error;
never executed: return error;
0
2409 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
2410 -
2411 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:343
0-343
2412 goto Fail3;
never executed: goto Fail3;
0
2413 -
2414 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
2415 -
2416 _hb_stream_frame_exit( stream ); -
2417 -
2418 cur_offset = _hb_stream_pos( stream ); -
2419 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:343
0-343
2420 ( error = _HB_OPEN_Load_Coverage( &mlp->LigatureCoverage, 0-343
2421 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_Coverage( &mlp->LigatureCoverage, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:343
0-343
2422 goto Fail3;
never executed: goto Fail3;
0
2423 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
2424 -
2425 if ( ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:343
0-343
2426 goto Fail2;
never executed: goto Fail2;
0
2427 -
2428 mlp->ClassCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2429 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
2430 -
2431 _hb_stream_frame_exit( stream ); -
2432 -
2433 cur_offset = _hb_stream_pos( stream ); -
2434 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:343
0-343
2435 ( error = Load_MarkArray( &mlp->MarkArray, stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_MarkArray( &mlp->MarkArray, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:343
0-343
2436 goto Fail2;
never executed: goto Fail2;
0
2437 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
2438 -
2439 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:343
0-343
2440 goto Fail1;
never executed: goto Fail1;
0
2441 -
2442 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
2443 -
2444 _hb_stream_frame_exit( stream ); -
2445 -
2446 cur_offset = _hb_stream_pos( stream ); -
2447 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:343
0-343
2448 ( error = Load_LigatureArray( &mlp->LigatureArray, mlp->ClassCount, 0-343
2449 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_LigatureArray( &mlp->LigatureArray, mlp->ClassCount, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:343
0-343
2450 goto Fail1;
never executed: goto Fail1;
0
2451 -
2452 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:343
343
2453 -
2454Fail1: -
2455 Free_MarkArray( &mlp->MarkArray ); -
2456 -
2457Fail2:
code before this statement never executed: Fail2:
0
2458 _HB_OPEN_Free_Coverage( &mlp->LigatureCoverage ); -
2459 -
2460Fail3:
code before this statement never executed: Fail3:
0
2461 _HB_OPEN_Free_Coverage( &mlp->MarkCoverage ); -
2462 return error;
never executed: return error;
0
2463} -
2464 -
2465 -
2466static void Free_MarkLigPos( HB_GPOS_SubTable* st) -
2467{ -
2468 HB_MarkLigPos* mlp = &st->marklig; -
2469 -
2470 Free_LigatureArray( &mlp->LigatureArray, mlp->ClassCount ); -
2471 Free_MarkArray( &mlp->MarkArray ); -
2472 _HB_OPEN_Free_Coverage( &mlp->LigatureCoverage ); -
2473 _HB_OPEN_Free_Coverage( &mlp->MarkCoverage ); -
2474}
executed: }
Execution Count:323
323
2475 -
2476 -
2477static HB_Error Lookup_MarkLigPos( GPOS_Instance* gpi, -
2478 HB_GPOS_SubTable* st, -
2479 HB_Buffer buffer, -
2480 HB_UShort flags, -
2481 HB_UShort context_length, -
2482 int nesting_level ) -
2483{ -
2484 HB_UShort i, j, mark_index, lig_index, property, class; -
2485 HB_UShort mark_glyph; -
2486 HB_Fixed x_mark_value, y_mark_value, x_lig_value, y_lig_value; -
2487 HB_Error error; -
2488 HB_GPOSHeader* gpos = gpi->gpos; -
2489 HB_MarkLigPos* mlp = &st->marklig; -
2490 -
2491 HB_MarkArray* ma; -
2492 HB_LigatureArray* la; -
2493 HB_LigatureAttach* lat; -
2494 HB_ComponentRecord* cr; -
2495 HB_UShort comp_index; -
2496 HB_Anchor* mark_anchor; -
2497 HB_Anchor* lig_anchor; -
2498 -
2499 HB_Position o; -
2500 -
2501 ((nesting_level) = (nesting_level)); -
2502 -
2503 if ( context_length != 0xFFFF && context_length < 1 )
partially evaluated: context_length != 0xFFFF
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2853864
never evaluated: context_length < 1
0-2853864
2504 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
2505 -
2506 if ( flags & 0x0004 )
partially evaluated: flags & 0x0004
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2853864
0-2853864
2507 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
2508 -
2509 mark_glyph = (buffer->in_string[buffer->in_pos].gindex); -
2510 -
2511 if ( ( ( error = _HB_GDEF_Check_Property( (gpos->gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok ) )
partially evaluated: ( ( error = _HB_GDEF_Check_Property( (gpos->gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2853864
0-2853864
2512 return error;
never executed: return error;
0
2513 -
2514 error = _HB_OPEN_Coverage_Index( &mlp->MarkCoverage, mark_glyph, &mark_index ); -
2515 if ( error )
partially evaluated: error
TRUEFALSE
yes
Evaluation Count:2853864
no
Evaluation Count:0
0-2853864
2516 return error;
executed: return error;
Execution Count:2853864
2853864
2517 -
2518 -
2519 -
2520 i = 1; -
2521 j = buffer->in_pos - 1; -
2522 -
2523 while ( i <= buffer->in_pos )
never evaluated: i <= buffer->in_pos
0
2524 { -
2525 error = HB_GDEF_Get_Glyph_Property( gpos->gdef, (buffer->in_string[(j)].gindex), -
2526 &property ); -
2527 if ( error )
never evaluated: error
0
2528 return error;
never executed: return error;
0
2529 -
2530 if ( !( property == 0x0008 || property & 0xFF00 ) )
never evaluated: property == 0x0008
never evaluated: property & 0xFF00
0
2531 break;
never executed: break;
0
2532 -
2533 i++; -
2534 j--; -
2535 }
never executed: }
0
2536 if ( i > buffer->in_pos )
never evaluated: i > buffer->in_pos
0
2537 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
2538 -
2539 error = _HB_OPEN_Coverage_Index( &mlp->LigatureCoverage, (buffer->in_string[(j)].gindex), -
2540 &lig_index ); -
2541 if ( error )
never evaluated: error
0
2542 return error;
never executed: return error;
0
2543 -
2544 ma = &mlp->MarkArray; -
2545 -
2546 if ( mark_index >= ma->MarkCount )
never evaluated: mark_index >= ma->MarkCount
0
2547 return _hb_err (HB_Err_Invalid_SubTable);
never executed: return _hb_err (HB_Err_Invalid_SubTable);
0
2548 -
2549 class = ma->MarkRecord[mark_index].Class; -
2550 mark_anchor = &ma->MarkRecord[mark_index].MarkAnchor; -
2551 -
2552 if ( class >= mlp->ClassCount )
never evaluated: class >= mlp->ClassCount
0
2553 return _hb_err (HB_Err_Invalid_SubTable);
never executed: return _hb_err (HB_Err_Invalid_SubTable);
0
2554 -
2555 la = &mlp->LigatureArray; -
2556 -
2557 if ( lig_index >= la->LigatureCount )
never evaluated: lig_index >= la->LigatureCount
0
2558 return _hb_err (HB_Err_Invalid_SubTable);
never executed: return _hb_err (HB_Err_Invalid_SubTable);
0
2559 -
2560 lat = &la->LigatureAttach[lig_index]; -
2561 -
2562 -
2563 -
2564 -
2565 -
2566 -
2567 if ( (buffer->in_string[(j)].ligID) == (buffer->in_string[(buffer->in_pos)].ligID) )
never evaluated: (buffer->in_string[(j)].ligID) == (buffer->in_string[(buffer->in_pos)].ligID)
0
2568 { -
2569 comp_index = (buffer->in_string[(buffer->in_pos)].component); -
2570 if ( comp_index >= lat->ComponentCount )
never evaluated: comp_index >= lat->ComponentCount
0
2571 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
2572 }
never executed: }
0
2573 else -
2574 comp_index = lat->ComponentCount - 1;
never executed: comp_index = lat->ComponentCount - 1;
0
2575 -
2576 cr = &lat->ComponentRecord[comp_index]; -
2577 lig_anchor = &cr->LigatureAnchor[class]; -
2578 -
2579 error = Get_Anchor( gpi, mark_anchor, (buffer->in_string[buffer->in_pos].gindex), -
2580 &x_mark_value, &y_mark_value ); -
2581 if ( error )
never evaluated: error
0
2582 return error;
never executed: return error;
0
2583 error = Get_Anchor( gpi, lig_anchor, (buffer->in_string[(j)].gindex), -
2584 &x_lig_value, &y_lig_value ); -
2585 if ( error )
never evaluated: error
0
2586 return error;
never executed: return error;
0
2587 -
2588 -
2589 -
2590 o = (&buffer->positions[(buffer->in_pos)]); -
2591 -
2592 o->x_pos = x_lig_value - x_mark_value; -
2593 o->y_pos = y_lig_value - y_mark_value; -
2594 o->x_advance = 0; -
2595 o->y_advance = 0; -
2596 o->back = i; -
2597 -
2598 (buffer->in_pos)++; -
2599 -
2600 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
2601} -
2602 -
2603 -
2604 -
2605 -
2606 -
2607 -
2608static HB_Error Load_Mark2Array( HB_Mark2Array* m2a, -
2609 HB_UShort num_classes, -
2610 HB_Stream stream ) -
2611{ -
2612 HB_Error error; -
2613 -
2614 HB_UShort m, n, count; -
2615 HB_UInt cur_offset, new_offset, base_offset; -
2616 -
2617 HB_Mark2Record *m2r; -
2618 HB_Anchor *m2an, *m2ans; -
2619 -
2620 -
2621 base_offset = _hb_stream_pos( stream ); -
2622 -
2623 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:753
0-753
2624 return error;
never executed: return error;
0
2625 -
2626 count = m2a->Mark2Count = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2627 -
2628 _hb_stream_frame_exit( stream ); -
2629 -
2630 m2a->Mark2Record = ((void *)0); -
2631 -
2632 if ( ( (m2a->Mark2Record) = _hb_alloc( (count)*sizeof(HB_Mark2Record), &error ), error != 0 ) )
partially evaluated: ( (m2a->Mark2Record) = _hb_alloc( (count)*sizeof(HB_Mark2Record), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:753
0-753
2633 return error;
never executed: return error;
0
2634 -
2635 m2r = m2a->Mark2Record; -
2636 -
2637 m2ans = ((void *)0); -
2638 -
2639 if ( ( (m2ans) = _hb_alloc( (count * num_classes)*sizeof(HB_Anchor), &error ), error != 0 ) )
partially evaluated: ( (m2ans) = _hb_alloc( (count * num_classes)*sizeof(HB_Anchor), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:753
0-753
2640 goto Fail;
never executed: goto Fail;
0
2641 -
2642 for ( m = 0; m < count; m++ )
evaluated: m < count
TRUEFALSE
yes
Evaluation Count:15078
yes
Evaluation Count:753
753-15078
2643 { -
2644 m2an = m2r[m].Mark2Anchor = m2ans + m * num_classes; -
2645 -
2646 for ( n = 0; n < num_classes; n++ )
evaluated: n < num_classes
TRUEFALSE
yes
Evaluation Count:15360
yes
Evaluation Count:15078
15078-15360
2647 { -
2648 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15360
0-15360
2649 goto Fail;
never executed: goto Fail;
0
2650 -
2651 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
2652 -
2653 _hb_stream_frame_exit( stream ); -
2654 -
2655 if (new_offset == base_offset) {
partially evaluated: new_offset == base_offset
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15360
0-15360
2656 -
2657 -
2658 m2an[n].PosFormat = 0; -
2659 continue;
never executed: continue;
0
2660 } -
2661 -
2662 cur_offset = _hb_stream_pos( stream ); -
2663 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15360
0-15360
2664 ( error = Load_Anchor( &m2an[n], stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_Anchor( &m2an[n], stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15360
0-15360
2665 goto Fail;
never executed: goto Fail;
0
2666 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
2667 }
executed: }
Execution Count:15360
15360
2668 }
executed: }
Execution Count:15078
15078
2669 -
2670 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:753
753
2671 -
2672Fail: -
2673 do { if ( (m2ans) ) { _hb_free( m2ans ); m2ans = ((void *)0); } } while (0);
never evaluated: (m2ans)
never evaluated: 0
never executed: }
never executed: }
0
2674 do { if ( (m2r) ) { _hb_free( m2r ); m2r = ((void *)0); } } while (0);
never evaluated: (m2r)
never evaluated: 0
never executed: }
never executed: }
0
2675 return error;
never executed: return error;
0
2676} -
2677 -
2678 -
2679static void Free_Mark2Array( HB_Mark2Array* m2a, -
2680 HB_UShort num_classes ) -
2681{ -
2682 HB_Mark2Record *m2r; -
2683 HB_Anchor *m2ans; -
2684 -
2685 ((num_classes) = (num_classes)); -
2686 -
2687 if ( m2a->Mark2Record )
partially evaluated: m2a->Mark2Record
TRUEFALSE
yes
Evaluation Count:715
no
Evaluation Count:0
0-715
2688 { -
2689 m2r = m2a->Mark2Record; -
2690 -
2691 if ( m2a->Mark2Count )
partially evaluated: m2a->Mark2Count
TRUEFALSE
yes
Evaluation Count:715
no
Evaluation Count:0
0-715
2692 { -
2693 m2ans = m2r[0].Mark2Anchor; -
2694 do { if ( (m2ans) ) { _hb_free( m2ans ); m2ans = ((void *)0); } } while (0);
partially evaluated: (m2ans)
TRUEFALSE
yes
Evaluation Count:715
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:715
executed: }
Execution Count:715
executed: }
Execution Count:715
0-715
2695 }
executed: }
Execution Count:715
715
2696 -
2697 do { if ( (m2r) ) { _hb_free( m2r ); m2r = ((void *)0); } } while (0);
partially evaluated: (m2r)
TRUEFALSE
yes
Evaluation Count:715
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:715
executed: }
Execution Count:715
executed: }
Execution Count:715
0-715
2698 }
executed: }
Execution Count:715
715
2699}
executed: }
Execution Count:715
715
2700 -
2701 -
2702 -
2703 -
2704static HB_Error Load_MarkMarkPos( HB_GPOS_SubTable* st, -
2705 HB_Stream stream ) -
2706{ -
2707 HB_Error error; -
2708 HB_MarkMarkPos* mmp = &st->markmark; -
2709 -
2710 HB_UInt cur_offset, new_offset, base_offset; -
2711 -
2712 -
2713 base_offset = _hb_stream_pos( stream ); -
2714 -
2715 if ( ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:753
0-753
2716 return error;
never executed: return error;
0
2717 -
2718 mmp->PosFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2719 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
2720 -
2721 _hb_stream_frame_exit( stream ); -
2722 -
2723 cur_offset = _hb_stream_pos( stream ); -
2724 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:753
0-753
2725 ( error = _HB_OPEN_Load_Coverage( &mmp->Mark1Coverage, 0-753
2726 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_Coverage( &mmp->Mark1Coverage, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:753
0-753
2727 return error;
never executed: return error;
0
2728 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
2729 -
2730 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:753
0-753
2731 goto Fail3;
never executed: goto Fail3;
0
2732 -
2733 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
2734 -
2735 _hb_stream_frame_exit( stream ); -
2736 -
2737 cur_offset = _hb_stream_pos( stream ); -
2738 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:753
0-753
2739 ( error = _HB_OPEN_Load_Coverage( &mmp->Mark2Coverage, 0-753
2740 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_Coverage( &mmp->Mark2Coverage, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:753
0-753
2741 goto Fail3;
never executed: goto Fail3;
0
2742 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
2743 -
2744 if ( ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:753
0-753
2745 goto Fail2;
never executed: goto Fail2;
0
2746 -
2747 mmp->ClassCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2748 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
2749 -
2750 _hb_stream_frame_exit( stream ); -
2751 -
2752 cur_offset = _hb_stream_pos( stream ); -
2753 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:753
0-753
2754 ( error = Load_MarkArray( &mmp->Mark1Array, stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_MarkArray( &mmp->Mark1Array, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:753
0-753
2755 goto Fail2;
never executed: goto Fail2;
0
2756 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
2757 -
2758 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:753
0-753
2759 goto Fail1;
never executed: goto Fail1;
0
2760 -
2761 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
2762 -
2763 _hb_stream_frame_exit( stream ); -
2764 -
2765 cur_offset = _hb_stream_pos( stream ); -
2766 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:753
0-753
2767 ( error = Load_Mark2Array( &mmp->Mark2Array, mmp->ClassCount, 0-753
2768 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_Mark2Array( &mmp->Mark2Array, mmp->ClassCount, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:753
0-753
2769 goto Fail1;
never executed: goto Fail1;
0
2770 -
2771 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:753
753
2772 -
2773Fail1: -
2774 Free_MarkArray( &mmp->Mark1Array ); -
2775 -
2776Fail2:
code before this statement never executed: Fail2:
0
2777 _HB_OPEN_Free_Coverage( &mmp->Mark2Coverage ); -
2778 -
2779Fail3:
code before this statement never executed: Fail3:
0
2780 _HB_OPEN_Free_Coverage( &mmp->Mark1Coverage ); -
2781 return error;
never executed: return error;
0
2782} -
2783 -
2784 -
2785static void Free_MarkMarkPos( HB_GPOS_SubTable* st) -
2786{ -
2787 HB_MarkMarkPos* mmp = &st->markmark; -
2788 -
2789 Free_Mark2Array( &mmp->Mark2Array, mmp->ClassCount ); -
2790 Free_MarkArray( &mmp->Mark1Array ); -
2791 _HB_OPEN_Free_Coverage( &mmp->Mark2Coverage ); -
2792 _HB_OPEN_Free_Coverage( &mmp->Mark1Coverage ); -
2793}
executed: }
Execution Count:715
715
2794 -
2795 -
2796static HB_Error Lookup_MarkMarkPos( GPOS_Instance* gpi, -
2797 HB_GPOS_SubTable* st, -
2798 HB_Buffer buffer, -
2799 HB_UShort flags, -
2800 HB_UShort context_length, -
2801 int nesting_level ) -
2802{ -
2803 HB_UShort i, j, mark1_index, mark2_index, property, class; -
2804 HB_Fixed x_mark1_value, y_mark1_value, -
2805 x_mark2_value, y_mark2_value; -
2806 HB_Error error; -
2807 HB_GPOSHeader* gpos = gpi->gpos; -
2808 HB_MarkMarkPos* mmp = &st->markmark; -
2809 -
2810 HB_MarkArray* ma1; -
2811 HB_Mark2Array* ma2; -
2812 HB_Mark2Record* m2r; -
2813 HB_Anchor* mark1_anchor; -
2814 HB_Anchor* mark2_anchor; -
2815 -
2816 HB_Position o; -
2817 -
2818 ((nesting_level) = (nesting_level)); -
2819 -
2820 if ( context_length != 0xFFFF && context_length < 1 )
partially evaluated: context_length != 0xFFFF
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6632244
never evaluated: context_length < 1
0-6632244
2821 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
2822 -
2823 if ( flags & 0x0008 )
partially evaluated: flags & 0x0008
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6632244
0-6632244
2824 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
2825 -
2826 if ( ( ( error = _HB_GDEF_Check_Property( (gpos->gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok ) )
evaluated: ( ( error = _HB_GDEF_Check_Property( (gpos->gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
TRUEFALSE
yes
Evaluation Count:19804
yes
Evaluation Count:6612440
19804-6612440
2827 -
2828 return error;
executed: return error;
Execution Count:19804
19804
2829 -
2830 error = _HB_OPEN_Coverage_Index( &mmp->Mark1Coverage, (buffer->in_string[buffer->in_pos].gindex), -
2831 &mark1_index ); -
2832 if ( error )
evaluated: error
TRUEFALSE
yes
Evaluation Count:6612340
yes
Evaluation Count:100
100-6612340
2833 return error;
executed: return error;
Execution Count:6612340
6612340
2834 -
2835 -
2836 -
2837 -
2838 if ( buffer->in_pos == 0 )
partially evaluated: buffer->in_pos == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:100
0-100
2839 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
2840 -
2841 i = 1; -
2842 j = buffer->in_pos - 1; -
2843 while ( i <= buffer->in_pos )
partially evaluated: i <= buffer->in_pos
TRUEFALSE
yes
Evaluation Count:100
no
Evaluation Count:0
0-100
2844 { -
2845 error = HB_GDEF_Get_Glyph_Property( gpos->gdef, (buffer->in_string[(j)].gindex), -
2846 &property ); -
2847 if ( error )
partially evaluated: error
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:100
0-100
2848 return error;
never executed: return error;
0
2849 -
2850 if ( !( property == 0x0008 || property & 0xFF00 ) )
evaluated: property == 0x0008
TRUEFALSE
yes
Evaluation Count:40
yes
Evaluation Count:60
partially evaluated: property & 0xFF00
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:60
0-60
2851 return HB_Err_Not_Covered;
executed: return HB_Err_Not_Covered;
Execution Count:60
60
2852 -
2853 if ( flags & 0xFF00 )
partially evaluated: flags & 0xFF00
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:40
0-40
2854 { -
2855 if ( property == (flags & 0xFF00) )
never evaluated: property == (flags & 0xFF00)
0
2856 break;
never executed: break;
0
2857 }
never executed: }
0
2858 else -
2859 break;
executed: break;
Execution Count:40
40
2860 -
2861 i++; -
2862 j--; -
2863 }
never executed: }
0
2864 -
2865 error = _HB_OPEN_Coverage_Index( &mmp->Mark2Coverage, (buffer->in_string[(j)].gindex), -
2866 &mark2_index ); -
2867 if ( error )
evaluated: error
TRUEFALSE
yes
Evaluation Count:24
yes
Evaluation Count:16
16-24
2868 return error;
executed: return error;
Execution Count:24
24
2869 -
2870 ma1 = &mmp->Mark1Array; -
2871 -
2872 if ( mark1_index >= ma1->MarkCount )
partially evaluated: mark1_index >= ma1->MarkCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16
0-16
2873 return _hb_err (HB_Err_Invalid_SubTable);
never executed: return _hb_err (HB_Err_Invalid_SubTable);
0
2874 -
2875 class = ma1->MarkRecord[mark1_index].Class; -
2876 mark1_anchor = &ma1->MarkRecord[mark1_index].MarkAnchor; -
2877 -
2878 if ( class >= mmp->ClassCount )
partially evaluated: class >= mmp->ClassCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16
0-16
2879 return _hb_err (HB_Err_Invalid_SubTable);
never executed: return _hb_err (HB_Err_Invalid_SubTable);
0
2880 -
2881 ma2 = &mmp->Mark2Array; -
2882 -
2883 if ( mark2_index >= ma2->Mark2Count )
partially evaluated: mark2_index >= ma2->Mark2Count
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16
0-16
2884 return _hb_err (HB_Err_Invalid_SubTable);
never executed: return _hb_err (HB_Err_Invalid_SubTable);
0
2885 -
2886 m2r = &ma2->Mark2Record[mark2_index]; -
2887 mark2_anchor = &m2r->Mark2Anchor[class]; -
2888 -
2889 error = Get_Anchor( gpi, mark1_anchor, (buffer->in_string[buffer->in_pos].gindex), -
2890 &x_mark1_value, &y_mark1_value ); -
2891 if ( error )
partially evaluated: error
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16
0-16
2892 return error;
never executed: return error;
0
2893 error = Get_Anchor( gpi, mark2_anchor, (buffer->in_string[(j)].gindex), -
2894 &x_mark2_value, &y_mark2_value ); -
2895 if ( error )
partially evaluated: error
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16
0-16
2896 return error;
never executed: return error;
0
2897 -
2898 -
2899 -
2900 o = (&buffer->positions[(buffer->in_pos)]); -
2901 -
2902 o->x_pos = x_mark2_value - x_mark1_value; -
2903 o->y_pos = y_mark2_value - y_mark1_value; -
2904 o->x_advance = 0; -
2905 o->y_advance = 0; -
2906 o->back = 1; -
2907 -
2908 (buffer->in_pos)++; -
2909 -
2910 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:16
16
2911} -
2912 -
2913 -
2914 -
2915 -
2916 -
2917 -
2918static HB_Error Do_ContextPos( GPOS_Instance* gpi, -
2919 HB_UShort GlyphCount, -
2920 HB_UShort PosCount, -
2921 HB_PosLookupRecord* pos, -
2922 HB_Buffer buffer, -
2923 int nesting_level ) -
2924{ -
2925 HB_Error error; -
2926 HB_UInt i, old_pos; -
2927 -
2928 -
2929 i = 0; -
2930 -
2931 while ( i < GlyphCount )
never evaluated: i < GlyphCount
0
2932 { -
2933 if ( PosCount && i == pos->SequenceIndex )
never evaluated: PosCount
never evaluated: i == pos->SequenceIndex
0
2934 { -
2935 old_pos = buffer->in_pos; -
2936 -
2937 -
2938 -
2939 error = GPOS_Do_Glyph_Lookup( gpi, pos->LookupListIndex, buffer, -
2940 GlyphCount, nesting_level ); -
2941 -
2942 if ( error )
never evaluated: error
0
2943 return error;
never executed: return error;
0
2944 -
2945 pos++; -
2946 PosCount--; -
2947 i += buffer->in_pos - old_pos; -
2948 }
never executed: }
0
2949 else -
2950 { -
2951 i++; -
2952 (buffer->in_pos)++; -
2953 }
never executed: }
0
2954 } -
2955 -
2956 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
2957} -
2958 -
2959 -
2960 -
2961 -
2962 -
2963 -
2964static HB_Error Load_PosRule( HB_PosRule* pr, -
2965 HB_Stream stream ) -
2966{ -
2967 HB_Error error; -
2968 -
2969 HB_UShort n, count; -
2970 HB_UShort* i; -
2971 -
2972 HB_PosLookupRecord* plr; -
2973 -
2974 -
2975 if ( ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
0
2976 return error;
never executed: return error;
0
2977 -
2978 pr->GlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2979 pr->PosCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2980 -
2981 _hb_stream_frame_exit( stream ); -
2982 -
2983 pr->Input = ((void *)0); -
2984 -
2985 count = pr->GlyphCount - 1; -
2986 -
2987 if ( ( (pr->Input) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
never evaluated: ( (pr->Input) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
0
2988 return error;
never executed: return error;
0
2989 -
2990 i = pr->Input; -
2991 -
2992 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
0
2993 goto Fail2;
never executed: goto Fail2;
0
2994 -
2995 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
2996 i[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
never executed: i[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
0
2997 -
2998 _hb_stream_frame_exit( stream ); -
2999 -
3000 pr->PosLookupRecord = ((void *)0); -
3001 -
3002 count = pr->PosCount; -
3003 -
3004 if ( ( (pr->PosLookupRecord) = _hb_alloc( (count)*sizeof(HB_PosLookupRecord), &error ), error != 0 ) )
never evaluated: ( (pr->PosLookupRecord) = _hb_alloc( (count)*sizeof(HB_PosLookupRecord), &error ), error != 0 )
0
3005 goto Fail2;
never executed: goto Fail2;
0
3006 -
3007 plr = pr->PosLookupRecord; -
3008 -
3009 if ( ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 )
0
3010 goto Fail1;
never executed: goto Fail1;
0
3011 -
3012 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
3013 { -
3014 plr[n].SequenceIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
3015 plr[n].LookupListIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
3016 }
never executed: }
0
3017 -
3018 _hb_stream_frame_exit( stream ); -
3019 -
3020 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
3021 -
3022Fail1: -
3023 do { if ( (plr) ) { _hb_free( plr ); plr = ((void *)0); } } while (0);
never evaluated: (plr)
never evaluated: 0
never executed: }
never executed: }
0
3024 -
3025Fail2:
code before this statement never executed: Fail2:
0
3026 do { if ( (i) ) { _hb_free( i ); i = ((void *)0); } } while (0);
never evaluated: (i)
never evaluated: 0
never executed: }
never executed: }
0
3027 return error;
never executed: return error;
0
3028} -
3029 -
3030 -
3031static void Free_PosRule( HB_PosRule* pr ) -
3032{ -
3033 do { if ( (pr->PosLookupRecord) ) { _hb_free( pr->PosLookupRecord ); pr->PosLookupRecord = ((void *)0); } } while (0);
never evaluated: (pr->PosLookupRecord)
never evaluated: 0
never executed: }
never executed: }
0
3034 do { if ( (pr->Input) ) { _hb_free( pr->Input ); pr->Input = ((void *)0); } } while (0);
never evaluated: (pr->Input)
never evaluated: 0
never executed: }
never executed: }
0
3035}
never executed: }
0
3036 -
3037 -
3038 -
3039 -
3040static HB_Error Load_PosRuleSet( HB_PosRuleSet* prs, -
3041 HB_Stream stream ) -
3042{ -
3043 HB_Error error; -
3044 -
3045 HB_UShort n, m, count; -
3046 HB_UInt cur_offset, new_offset, base_offset; -
3047 -
3048 HB_PosRule* pr; -
3049 -
3050 -
3051 base_offset = _hb_stream_pos( stream ); -
3052 -
3053 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3054 return error;
never executed: return error;
0
3055 -
3056 count = prs->PosRuleCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
3057 -
3058 _hb_stream_frame_exit( stream ); -
3059 -
3060 prs->PosRule = ((void *)0); -
3061 -
3062 if ( ( (prs->PosRule) = _hb_alloc( (count)*sizeof(HB_PosRule), &error ), error != 0 ) )
never evaluated: ( (prs->PosRule) = _hb_alloc( (count)*sizeof(HB_PosRule), &error ), error != 0 )
0
3063 return error;
never executed: return error;
0
3064 -
3065 pr = prs->PosRule; -
3066 -
3067 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
3068 { -
3069 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3070 goto Fail;
never executed: goto Fail;
0
3071 -
3072 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
3073 -
3074 _hb_stream_frame_exit( stream ); -
3075 -
3076 cur_offset = _hb_stream_pos( stream ); -
3077 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
3078 ( error = Load_PosRule( &pr[n], stream ) ) != HB_Err_Ok )
never evaluated: ( error = Load_PosRule( &pr[n], stream ) ) != HB_Err_Ok
0
3079 goto Fail;
never executed: goto Fail;
0
3080 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
3081 }
never executed: }
0
3082 -
3083 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
3084 -
3085Fail: -
3086 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
3087 Free_PosRule( &pr[m] );
never executed: Free_PosRule( &pr[m] );
0
3088 -
3089 do { if ( (pr) ) { _hb_free( pr ); pr = ((void *)0); } } while (0);
never evaluated: (pr)
never evaluated: 0
never executed: }
never executed: }
0
3090 return error;
never executed: return error;
0
3091} -
3092 -
3093 -
3094static void Free_PosRuleSet( HB_PosRuleSet* prs ) -
3095{ -
3096 HB_UShort n, count; -
3097 -
3098 HB_PosRule* pr; -
3099 -
3100 -
3101 if ( prs->PosRule )
never evaluated: prs->PosRule
0
3102 { -
3103 count = prs->PosRuleCount; -
3104 pr = prs->PosRule; -
3105 -
3106 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
3107 Free_PosRule( &pr[n] );
never executed: Free_PosRule( &pr[n] );
0
3108 -
3109 do { if ( (pr) ) { _hb_free( pr ); pr = ((void *)0); } } while (0);
never evaluated: (pr)
never evaluated: 0
never executed: }
never executed: }
0
3110 }
never executed: }
0
3111}
never executed: }
0
3112 -
3113 -
3114 -
3115 -
3116static HB_Error Load_ContextPos1( HB_ContextPosFormat1* cpf1, -
3117 HB_Stream stream ) -
3118{ -
3119 HB_Error error; -
3120 -
3121 HB_UShort n, m, count; -
3122 HB_UInt cur_offset, new_offset, base_offset; -
3123 -
3124 HB_PosRuleSet* prs; -
3125 -
3126 -
3127 base_offset = _hb_stream_pos( stream ) - 2L; -
3128 -
3129 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3130 return error;
never executed: return error;
0
3131 -
3132 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
3133 -
3134 _hb_stream_frame_exit( stream ); -
3135 -
3136 cur_offset = _hb_stream_pos( stream ); -
3137 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
3138 ( error = _HB_OPEN_Load_Coverage( &cpf1->Coverage, stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Coverage( &cpf1->Coverage, stream ) ) != HB_Err_Ok
0
3139 return error;
never executed: return error;
0
3140 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
3141 -
3142 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3143 goto Fail2;
never executed: goto Fail2;
0
3144 -
3145 count = cpf1->PosRuleSetCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
3146 -
3147 _hb_stream_frame_exit( stream ); -
3148 -
3149 cpf1->PosRuleSet = ((void *)0); -
3150 -
3151 if ( ( (cpf1->PosRuleSet) = _hb_alloc( (count)*sizeof(HB_PosRuleSet), &error ), error != 0 ) )
never evaluated: ( (cpf1->PosRuleSet) = _hb_alloc( (count)*sizeof(HB_PosRuleSet), &error ), error != 0 )
0
3152 goto Fail2;
never executed: goto Fail2;
0
3153 -
3154 prs = cpf1->PosRuleSet; -
3155 -
3156 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
3157 { -
3158 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3159 goto Fail1;
never executed: goto Fail1;
0
3160 -
3161 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
3162 -
3163 _hb_stream_frame_exit( stream ); -
3164 -
3165 cur_offset = _hb_stream_pos( stream ); -
3166 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
3167 ( error = Load_PosRuleSet( &prs[n], stream ) ) != HB_Err_Ok )
never evaluated: ( error = Load_PosRuleSet( &prs[n], stream ) ) != HB_Err_Ok
0
3168 goto Fail1;
never executed: goto Fail1;
0
3169 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
3170 }
never executed: }
0
3171 -
3172 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
3173 -
3174Fail1: -
3175 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
3176 Free_PosRuleSet( &prs[m] );
never executed: Free_PosRuleSet( &prs[m] );
0
3177 -
3178 do { if ( (prs) ) { _hb_free( prs ); prs = ((void *)0); } } while (0);
never evaluated: (prs)
never evaluated: 0
never executed: }
never executed: }
0
3179 -
3180Fail2:
code before this statement never executed: Fail2:
0
3181 _HB_OPEN_Free_Coverage( &cpf1->Coverage ); -
3182 return error;
never executed: return error;
0
3183} -
3184 -
3185 -
3186static void Free_ContextPos1( HB_ContextPosFormat1* cpf1 ) -
3187{ -
3188 HB_UShort n, count; -
3189 -
3190 HB_PosRuleSet* prs; -
3191 -
3192 -
3193 if ( cpf1->PosRuleSet )
never evaluated: cpf1->PosRuleSet
0
3194 { -
3195 count = cpf1->PosRuleSetCount; -
3196 prs = cpf1->PosRuleSet; -
3197 -
3198 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
3199 Free_PosRuleSet( &prs[n] );
never executed: Free_PosRuleSet( &prs[n] );
0
3200 -
3201 do { if ( (prs) ) { _hb_free( prs ); prs = ((void *)0); } } while (0);
never evaluated: (prs)
never evaluated: 0
never executed: }
never executed: }
0
3202 }
never executed: }
0
3203 -
3204 _HB_OPEN_Free_Coverage( &cpf1->Coverage ); -
3205}
never executed: }
0
3206 -
3207 -
3208 -
3209 -
3210static HB_Error Load_PosClassRule( HB_ContextPosFormat2* cpf2, -
3211 HB_PosClassRule* pcr, -
3212 HB_Stream stream ) -
3213{ -
3214 HB_Error error; -
3215 -
3216 HB_UShort n, count; -
3217 -
3218 HB_UShort* c; -
3219 HB_PosLookupRecord* plr; -
3220 -
3221 -
3222 if ( ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
0
3223 return error;
never executed: return error;
0
3224 -
3225 pcr->GlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
3226 pcr->PosCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
3227 -
3228 _hb_stream_frame_exit( stream ); -
3229 -
3230 if ( pcr->GlyphCount > cpf2->MaxContextLength )
never evaluated: pcr->GlyphCount > cpf2->MaxContextLength
0
3231 cpf2->MaxContextLength = pcr->GlyphCount;
never executed: cpf2->MaxContextLength = pcr->GlyphCount;
0
3232 -
3233 pcr->Class = ((void *)0); -
3234 -
3235 count = pcr->GlyphCount - 1; -
3236 -
3237 if ( ( (pcr->Class) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
never evaluated: ( (pcr->Class) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
0
3238 return error;
never executed: return error;
0
3239 -
3240 c = pcr->Class; -
3241 -
3242 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
0
3243 goto Fail2;
never executed: goto Fail2;
0
3244 -
3245 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
3246 c[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
never executed: c[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
0
3247 -
3248 _hb_stream_frame_exit( stream ); -
3249 -
3250 pcr->PosLookupRecord = ((void *)0); -
3251 -
3252 count = pcr->PosCount; -
3253 -
3254 if ( ( (pcr->PosLookupRecord) = _hb_alloc( (count)*sizeof(HB_PosLookupRecord), &error ), error != 0 ) )
never evaluated: ( (pcr->PosLookupRecord) = _hb_alloc( (count)*sizeof(HB_PosLookupRecord), &error ), error != 0 )
0
3255 goto Fail2;
never executed: goto Fail2;
0
3256 -
3257 plr = pcr->PosLookupRecord; -
3258 -
3259 if ( ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 )
0
3260 goto Fail1;
never executed: goto Fail1;
0
3261 -
3262 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
3263 { -
3264 plr[n].SequenceIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
3265 plr[n].LookupListIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
3266 }
never executed: }
0
3267 -
3268 _hb_stream_frame_exit( stream ); -
3269 -
3270 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
3271 -
3272Fail1: -
3273 do { if ( (plr) ) { _hb_free( plr ); plr = ((void *)0); } } while (0);
never evaluated: (plr)
never evaluated: 0
never executed: }
never executed: }
0
3274 -
3275Fail2:
code before this statement never executed: Fail2:
0
3276 do { if ( (c) ) { _hb_free( c ); c = ((void *)0); } } while (0);
never evaluated: (c)
never evaluated: 0
never executed: }
never executed: }
0
3277 return error;
never executed: return error;
0
3278} -
3279 -
3280 -
3281static void Free_PosClassRule( HB_PosClassRule* pcr ) -
3282{ -
3283 do { if ( (pcr->PosLookupRecord) ) { _hb_free( pcr->PosLookupRecord ); pcr->PosLookupRecord = ((void *)0); } } while (0);
never evaluated: (pcr->PosLookupRecord)
never evaluated: 0
never executed: }
never executed: }
0
3284 do { if ( (pcr->Class) ) { _hb_free( pcr->Class ); pcr->Class = ((void *)0); } } while (0);
never evaluated: (pcr->Class)
never evaluated: 0
never executed: }
never executed: }
0
3285}
never executed: }
0
3286 -
3287 -
3288 -
3289 -
3290static HB_Error Load_PosClassSet( HB_ContextPosFormat2* cpf2, -
3291 HB_PosClassSet* pcs, -
3292 HB_Stream stream ) -
3293{ -
3294 HB_Error error; -
3295 -
3296 HB_UShort n, m, count; -
3297 HB_UInt cur_offset, new_offset, base_offset; -
3298 -
3299 HB_PosClassRule* pcr; -
3300 -
3301 -
3302 base_offset = _hb_stream_pos( stream ); -
3303 -
3304 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3305 return error;
never executed: return error;
0
3306 -
3307 count = pcs->PosClassRuleCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
3308 -
3309 _hb_stream_frame_exit( stream ); -
3310 -
3311 pcs->PosClassRule = ((void *)0); -
3312 -
3313 if ( ( (pcs->PosClassRule) = _hb_alloc( (count)*sizeof(HB_PosClassRule), &error ), error != 0 ) )
never evaluated: ( (pcs->PosClassRule) = _hb_alloc( (count)*sizeof(HB_PosClassRule), &error ), error != 0 )
0
3314 return error;
never executed: return error;
0
3315 -
3316 pcr = pcs->PosClassRule; -
3317 -
3318 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
3319 { -
3320 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3321 goto Fail;
never executed: goto Fail;
0
3322 -
3323 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
3324 -
3325 _hb_stream_frame_exit( stream ); -
3326 -
3327 cur_offset = _hb_stream_pos( stream ); -
3328 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
3329 ( error = Load_PosClassRule( cpf2, &pcr[n], 0
3330 stream ) ) != HB_Err_Ok )
never evaluated: ( error = Load_PosClassRule( cpf2, &pcr[n], stream ) ) != HB_Err_Ok
0
3331 goto Fail;
never executed: goto Fail;
0
3332 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
3333 }
never executed: }
0
3334 -
3335 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
3336 -
3337Fail: -
3338 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
3339 Free_PosClassRule( &pcr[m] );
never executed: Free_PosClassRule( &pcr[m] );
0
3340 -
3341 do { if ( (pcr) ) { _hb_free( pcr ); pcr = ((void *)0); } } while (0);
never evaluated: (pcr)
never evaluated: 0
never executed: }
never executed: }
0
3342 return error;
never executed: return error;
0
3343} -
3344 -
3345 -
3346static void Free_PosClassSet( HB_PosClassSet* pcs ) -
3347{ -
3348 HB_UShort n, count; -
3349 -
3350 HB_PosClassRule* pcr; -
3351 -
3352 -
3353 if ( pcs->PosClassRule )
never evaluated: pcs->PosClassRule
0
3354 { -
3355 count = pcs->PosClassRuleCount; -
3356 pcr = pcs->PosClassRule; -
3357 -
3358 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
3359 Free_PosClassRule( &pcr[n] );
never executed: Free_PosClassRule( &pcr[n] );
0
3360 -
3361 do { if ( (pcr) ) { _hb_free( pcr ); pcr = ((void *)0); } } while (0);
never evaluated: (pcr)
never evaluated: 0
never executed: }
never executed: }
0
3362 }
never executed: }
0
3363}
never executed: }
0
3364 -
3365 -
3366 -
3367 -
3368static HB_Error Load_ContextPos2( HB_ContextPosFormat2* cpf2, -
3369 HB_Stream stream ) -
3370{ -
3371 HB_Error error; -
3372 -
3373 HB_UShort n, m, count; -
3374 HB_UInt cur_offset, new_offset, base_offset; -
3375 -
3376 HB_PosClassSet* pcs; -
3377 -
3378 -
3379 base_offset = _hb_stream_pos( stream ) - 2; -
3380 -
3381 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3382 return error;
never executed: return error;
0
3383 -
3384 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
3385 -
3386 _hb_stream_frame_exit( stream ); -
3387 -
3388 cur_offset = _hb_stream_pos( stream ); -
3389 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
3390 ( error = _HB_OPEN_Load_Coverage( &cpf2->Coverage, stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Coverage( &cpf2->Coverage, stream ) ) != HB_Err_Ok
0
3391 return error;
never executed: return error;
0
3392 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
3393 -
3394 if ( ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
0
3395 goto Fail3;
never executed: goto Fail3;
0
3396 -
3397 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
3398 -
3399 -
3400 -
3401 -
3402 count = cpf2->PosClassSetCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
3403 -
3404 _hb_stream_frame_exit( stream ); -
3405 -
3406 cur_offset = _hb_stream_pos( stream ); -
3407 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
3408 ( error = _HB_OPEN_Load_ClassDefinition( &cpf2->ClassDef, count, 0
3409 stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_ClassDefinition( &cpf2->ClassDef, count, stream ) ) != HB_Err_Ok
0
3410 goto Fail3;
never executed: goto Fail3;
0
3411 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
3412 -
3413 cpf2->PosClassSet = ((void *)0); -
3414 cpf2->MaxContextLength = 0; -
3415 -
3416 if ( ( (cpf2->PosClassSet) = _hb_alloc( (count)*sizeof(HB_PosClassSet), &error ), error != 0 ) )
never evaluated: ( (cpf2->PosClassSet) = _hb_alloc( (count)*sizeof(HB_PosClassSet), &error ), error != 0 )
0
3417 goto Fail2;
never executed: goto Fail2;
0
3418 -
3419 pcs = cpf2->PosClassSet; -
3420 -
3421 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
3422 { -
3423 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3424 goto Fail1;
never executed: goto Fail1;
0
3425 -
3426 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
3427 -
3428 _hb_stream_frame_exit( stream ); -
3429 -
3430 if ( new_offset != base_offset )
never evaluated: new_offset != base_offset
0
3431 { -
3432 cur_offset = _hb_stream_pos( stream ); -
3433 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
3434 ( error = Load_PosClassSet( cpf2, &pcs[n], 0
3435 stream ) ) != HB_Err_Ok )
never evaluated: ( error = Load_PosClassSet( cpf2, &pcs[n], stream ) ) != HB_Err_Ok
0
3436 goto Fail1;
never executed: goto Fail1;
0
3437 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
3438 }
never executed: }
0
3439 else -
3440 { -
3441 -
3442 -
3443 cpf2->PosClassSet[n].PosClassRuleCount = 0; -
3444 cpf2->PosClassSet[n].PosClassRule = ((void *)0); -
3445 }
never executed: }
0
3446 } -
3447 -
3448 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
3449 -
3450Fail1: -
3451 for ( m = 0; m < n; n++ )
never evaluated: m < n
0
3452 Free_PosClassSet( &pcs[m] );
never executed: Free_PosClassSet( &pcs[m] );
0
3453 -
3454 do { if ( (pcs) ) { _hb_free( pcs ); pcs = ((void *)0); } } while (0);
never evaluated: (pcs)
never evaluated: 0
never executed: }
never executed: }
0
3455 -
3456Fail2:
code before this statement never executed: Fail2:
0
3457 _HB_OPEN_Free_ClassDefinition( &cpf2->ClassDef ); -
3458 -
3459Fail3:
code before this statement never executed: Fail3:
0
3460 _HB_OPEN_Free_Coverage( &cpf2->Coverage ); -
3461 return error;
never executed: return error;
0
3462} -
3463 -
3464 -
3465static void Free_ContextPos2( HB_ContextPosFormat2* cpf2 ) -
3466{ -
3467 HB_UShort n, count; -
3468 -
3469 HB_PosClassSet* pcs; -
3470 -
3471 -
3472 if ( cpf2->PosClassSet )
never evaluated: cpf2->PosClassSet
0
3473 { -
3474 count = cpf2->PosClassSetCount; -
3475 pcs = cpf2->PosClassSet; -
3476 -
3477 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
3478 Free_PosClassSet( &pcs[n] );
never executed: Free_PosClassSet( &pcs[n] );
0
3479 -
3480 do { if ( (pcs) ) { _hb_free( pcs ); pcs = ((void *)0); } } while (0);
never evaluated: (pcs)
never evaluated: 0
never executed: }
never executed: }
0
3481 }
never executed: }
0
3482 -
3483 _HB_OPEN_Free_ClassDefinition( &cpf2->ClassDef ); -
3484 _HB_OPEN_Free_Coverage( &cpf2->Coverage ); -
3485}
never executed: }
0
3486 -
3487 -
3488 -
3489 -
3490static HB_Error Load_ContextPos3( HB_ContextPosFormat3* cpf3, -
3491 HB_Stream stream ) -
3492{ -
3493 HB_Error error; -
3494 -
3495 HB_UShort n, count; -
3496 HB_UInt cur_offset, new_offset, base_offset; -
3497 -
3498 HB_Coverage* c; -
3499 HB_PosLookupRecord* plr; -
3500 -
3501 -
3502 base_offset = _hb_stream_pos( stream ) - 2L; -
3503 -
3504 if ( ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
0
3505 return error;
never executed: return error;
0
3506 -
3507 cpf3->GlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
3508 cpf3->PosCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
3509 -
3510 _hb_stream_frame_exit( stream ); -
3511 -
3512 cpf3->Coverage = ((void *)0); -
3513 -
3514 count = cpf3->GlyphCount; -
3515 -
3516 if ( ( (cpf3->Coverage) = _hb_alloc( (count)*sizeof(HB_Coverage), &error ), error != 0 ) )
never evaluated: ( (cpf3->Coverage) = _hb_alloc( (count)*sizeof(HB_Coverage), &error ), error != 0 )
0
3517 return error;
never executed: return error;
0
3518 -
3519 c = cpf3->Coverage; -
3520 -
3521 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
3522 { -
3523 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3524 goto Fail2;
never executed: goto Fail2;
0
3525 -
3526 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
3527 -
3528 _hb_stream_frame_exit( stream ); -
3529 -
3530 cur_offset = _hb_stream_pos( stream ); -
3531 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
3532 ( error = _HB_OPEN_Load_Coverage( &c[n], stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Coverage( &c[n], stream ) ) != HB_Err_Ok
0
3533 goto Fail2;
never executed: goto Fail2;
0
3534 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
3535 }
never executed: }
0
3536 -
3537 cpf3->PosLookupRecord = ((void *)0); -
3538 -
3539 count = cpf3->PosCount; -
3540 -
3541 if ( ( (cpf3->PosLookupRecord) = _hb_alloc( (count)*sizeof(HB_PosLookupRecord), &error ), error != 0 ) )
never evaluated: ( (cpf3->PosLookupRecord) = _hb_alloc( (count)*sizeof(HB_PosLookupRecord), &error ), error != 0 )
0
3542 goto Fail2;
never executed: goto Fail2;
0
3543 -
3544 plr = cpf3->PosLookupRecord; -
3545 -
3546 if ( ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 )
0
3547 goto Fail1;
never executed: goto Fail1;
0
3548 -
3549 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
3550 { -
3551 plr[n].SequenceIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
3552 plr[n].LookupListIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
3553 }
never executed: }
0
3554 -
3555 _hb_stream_frame_exit( stream ); -
3556 -
3557 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
3558 -
3559Fail1: -
3560 do { if ( (plr) ) { _hb_free( plr ); plr = ((void *)0); } } while (0);
never evaluated: (plr)
never evaluated: 0
never executed: }
never executed: }
0
3561 -
3562Fail2:
code before this statement never executed: Fail2:
0
3563 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
3564 _HB_OPEN_Free_Coverage( &c[n] );
never executed: _HB_OPEN_Free_Coverage( &c[n] );
0
3565 -
3566 do { if ( (c) ) { _hb_free( c ); c = ((void *)0); } } while (0);
never evaluated: (c)
never evaluated: 0
never executed: }
never executed: }
0
3567 return error;
never executed: return error;
0
3568} -
3569 -
3570 -
3571static void Free_ContextPos3( HB_ContextPosFormat3* cpf3 ) -
3572{ -
3573 HB_UShort n, count; -
3574 -
3575 HB_Coverage* c; -
3576 -
3577 -
3578 do { if ( (cpf3->PosLookupRecord) ) { _hb_free( cpf3->PosLookupRecord ); cpf3->PosLookupRecord = ((void *)0); } } while (0);
never evaluated: (cpf3->PosLookupRecord)
never evaluated: 0
never executed: }
never executed: }
0
3579 -
3580 if ( cpf3->Coverage )
never evaluated: cpf3->Coverage
0
3581 { -
3582 count = cpf3->GlyphCount; -
3583 c = cpf3->Coverage; -
3584 -
3585 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
3586 _HB_OPEN_Free_Coverage( &c[n] );
never executed: _HB_OPEN_Free_Coverage( &c[n] );
0
3587 -
3588 do { if ( (c) ) { _hb_free( c ); c = ((void *)0); } } while (0);
never evaluated: (c)
never evaluated: 0
never executed: }
never executed: }
0
3589 }
never executed: }
0
3590}
never executed: }
0
3591 -
3592 -
3593 -
3594 -
3595static HB_Error Load_ContextPos( HB_GPOS_SubTable* st, -
3596 HB_Stream stream ) -
3597{ -
3598 HB_Error error; -
3599 HB_ContextPos* cp = &st->context; -
3600 -
3601 -
3602 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3603 return error;
never executed: return error;
0
3604 -
3605 cp->PosFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
3606 -
3607 _hb_stream_frame_exit( stream ); -
3608 -
3609 switch ( cp->PosFormat ) -
3610 { -
3611 case 1: -
3612 return Load_ContextPos1( &cp->cpf.cpf1, stream );
never executed: return Load_ContextPos1( &cp->cpf.cpf1, stream );
0
3613 -
3614 case 2: -
3615 return Load_ContextPos2( &cp->cpf.cpf2, stream );
never executed: return Load_ContextPos2( &cp->cpf.cpf2, stream );
0
3616 -
3617 case 3: -
3618 return Load_ContextPos3( &cp->cpf.cpf3, stream );
never executed: return Load_ContextPos3( &cp->cpf.cpf3, stream );
0
3619 -
3620 default: -
3621 return _hb_err (HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
3622 } -
3623 -
3624 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
3625} -
3626 -
3627 -
3628static void Free_ContextPos( HB_GPOS_SubTable* st ) -
3629{ -
3630 HB_ContextPos* cp = &st->context; -
3631 -
3632 switch ( cp->PosFormat ) -
3633 { -
3634 case 1: Free_ContextPos1( &cp->cpf.cpf1 ); break;
never executed: break;
0
3635 case 2: Free_ContextPos2( &cp->cpf.cpf2 ); break;
never executed: break;
0
3636 case 3: Free_ContextPos3( &cp->cpf.cpf3 ); break;
never executed: break;
0
3637 default: break;
never executed: break;
0
3638 } -
3639}
never executed: }
0
3640 -
3641 -
3642static HB_Error Lookup_ContextPos1( GPOS_Instance* gpi, -
3643 HB_ContextPosFormat1* cpf1, -
3644 HB_Buffer buffer, -
3645 HB_UShort flags, -
3646 HB_UShort context_length, -
3647 int nesting_level ) -
3648{ -
3649 HB_UShort index, property; -
3650 HB_UShort i, j, k, numpr; -
3651 HB_Error error; -
3652 HB_GPOSHeader* gpos = gpi->gpos; -
3653 -
3654 HB_PosRule* pr; -
3655 HB_GDEFHeader* gdef; -
3656 -
3657 -
3658 gdef = gpos->gdef; -
3659 -
3660 if ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
0
3661 return error;
never executed: return error;
0
3662 -
3663 error = _HB_OPEN_Coverage_Index( &cpf1->Coverage, (buffer->in_string[buffer->in_pos].gindex), &index ); -
3664 if ( error )
never evaluated: error
0
3665 return error;
never executed: return error;
0
3666 -
3667 pr = cpf1->PosRuleSet[index].PosRule; -
3668 numpr = cpf1->PosRuleSet[index].PosRuleCount; -
3669 -
3670 for ( k = 0; k < numpr; k++ )
never evaluated: k < numpr
0
3671 { -
3672 if ( context_length != 0xFFFF && context_length < pr[k].GlyphCount )
never evaluated: context_length != 0xFFFF
never evaluated: context_length < pr[k].GlyphCount
0
3673 goto next_posrule;
never executed: goto next_posrule;
0
3674 -
3675 if ( buffer->in_pos + pr[k].GlyphCount > buffer->in_length )
never evaluated: buffer->in_pos + pr[k].GlyphCount > buffer->in_length
0
3676 goto next_posrule;
never executed: goto next_posrule;
0
3677 -
3678 for ( i = 1, j = buffer->in_pos + 1; i < pr[k].GlyphCount; i++, j++ )
never evaluated: i < pr[k].GlyphCount
0
3679 { -
3680 while ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
3681 { -
3682 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3683 return error;
never executed: return error;
0
3684 -
3685 if ( j + pr[k].GlyphCount - i == (HB_Int)buffer->in_length )
never evaluated: j + pr[k].GlyphCount - i == (HB_Int)buffer->in_length
0
3686 goto next_posrule;
never executed: goto next_posrule;
0
3687 j++; -
3688 }
never executed: }
0
3689 -
3690 if ( (buffer->in_string[(j)].gindex) != pr[k].Input[i - 1] )
never evaluated: (buffer->in_string[(j)].gindex) != pr[k].Input[i - 1]
0
3691 goto next_posrule;
never executed: goto next_posrule;
0
3692 }
never executed: }
0
3693 -
3694 return Do_ContextPos( gpi, pr[k].GlyphCount, 0
3695 pr[k].PosCount, pr[k].PosLookupRecord, 0
3696 buffer, 0
3697 nesting_level );
never executed: return Do_ContextPos( gpi, pr[k].GlyphCount, pr[k].PosCount, pr[k].PosLookupRecord, buffer, nesting_level );
0
3698 -
3699 next_posrule: -
3700 ; -
3701 }
never executed: }
0
3702 -
3703 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3704} -
3705 -
3706 -
3707static HB_Error Lookup_ContextPos2( GPOS_Instance* gpi, -
3708 HB_ContextPosFormat2* cpf2, -
3709 HB_Buffer buffer, -
3710 HB_UShort flags, -
3711 HB_UShort context_length, -
3712 int nesting_level ) -
3713{ -
3714 HB_UShort index, property; -
3715 HB_Error error; -
3716 HB_UShort i, j, k, known_classes; -
3717 -
3718 HB_UShort* classes; -
3719 HB_UShort* cl; -
3720 HB_GPOSHeader* gpos = gpi->gpos; -
3721 -
3722 HB_PosClassSet* pcs; -
3723 HB_PosClassRule* pr; -
3724 HB_GDEFHeader* gdef; -
3725 -
3726 -
3727 gdef = gpos->gdef; -
3728 -
3729 if ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
0
3730 return error;
never executed: return error;
0
3731 -
3732 -
3733 -
3734 -
3735 -
3736 error = _HB_OPEN_Coverage_Index( &cpf2->Coverage, (buffer->in_string[buffer->in_pos].gindex), &index ); -
3737 if ( error )
never evaluated: error
0
3738 return error;
never executed: return error;
0
3739 -
3740 if (cpf2->MaxContextLength < 1)
never evaluated: cpf2->MaxContextLength < 1
0
3741 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3742 -
3743 if ( ( (classes) = _hb_alloc( (cpf2->MaxContextLength)*sizeof(HB_UShort), &error ), error != 0 ) )
never evaluated: ( (classes) = _hb_alloc( (cpf2->MaxContextLength)*sizeof(HB_UShort), &error ), error != 0 )
0
3744 return error;
never executed: return error;
0
3745 -
3746 error = _HB_OPEN_Get_Class( &cpf2->ClassDef, (buffer->in_string[buffer->in_pos].gindex), -
3747 &classes[0], ((void *)0) ); -
3748 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3749 goto End;
never executed: goto End;
0
3750 known_classes = 0; -
3751 -
3752 pcs = &cpf2->PosClassSet[classes[0]]; -
3753 if ( !pcs )
never evaluated: !pcs
0
3754 { -
3755 error = _hb_err (HB_Err_Invalid_SubTable); -
3756 goto End;
never executed: goto End;
0
3757 } -
3758 -
3759 for ( k = 0; k < pcs->PosClassRuleCount; k++ )
never evaluated: k < pcs->PosClassRuleCount
0
3760 { -
3761 pr = &pcs->PosClassRule[k]; -
3762 -
3763 if ( context_length != 0xFFFF && context_length < pr->GlyphCount )
never evaluated: context_length != 0xFFFF
never evaluated: context_length < pr->GlyphCount
0
3764 goto next_posclassrule;
never executed: goto next_posclassrule;
0
3765 -
3766 if ( buffer->in_pos + pr->GlyphCount > buffer->in_length )
never evaluated: buffer->in_pos + pr->GlyphCount > buffer->in_length
0
3767 goto next_posclassrule;
never executed: goto next_posclassrule;
0
3768 -
3769 cl = pr->Class; -
3770 -
3771 -
3772 -
3773 for ( i = 1, j = buffer->in_pos + 1; i < pr->GlyphCount; i++, j++ )
never evaluated: i < pr->GlyphCount
0
3774 { -
3775 while ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
3776 { -
3777 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3778 goto End;
never executed: goto End;
0
3779 -
3780 if ( j + pr->GlyphCount - i == (HB_Int)buffer->in_length )
never evaluated: j + pr->GlyphCount - i == (HB_Int)buffer->in_length
0
3781 goto next_posclassrule;
never executed: goto next_posclassrule;
0
3782 j++; -
3783 }
never executed: }
0
3784 -
3785 if ( i > known_classes )
never evaluated: i > known_classes
0
3786 { -
3787 -
3788 -
3789 error = _HB_OPEN_Get_Class( &cpf2->ClassDef, (buffer->in_string[(j)].gindex), &classes[i], ((void *)0) ); -
3790 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3791 goto End;
never executed: goto End;
0
3792 known_classes = i; -
3793 }
never executed: }
0
3794 -
3795 if ( cl[i - 1] != classes[i] )
never evaluated: cl[i - 1] != classes[i]
0
3796 goto next_posclassrule;
never executed: goto next_posclassrule;
0
3797 }
never executed: }
0
3798 -
3799 error = Do_ContextPos( gpi, pr->GlyphCount, -
3800 pr->PosCount, pr->PosLookupRecord, -
3801 buffer, -
3802 nesting_level ); -
3803 goto End;
never executed: goto End;
0
3804 -
3805 next_posclassrule: -
3806 ; -
3807 }
never executed: }
0
3808 -
3809 error = HB_Err_Not_Covered; -
3810 -
3811End:
code before this statement never executed: End:
0
3812 do { if ( (classes) ) { _hb_free( classes ); classes = ((void *)0); } } while (0);
never evaluated: (classes)
never evaluated: 0
never executed: }
never executed: }
0
3813 return error;
never executed: return error;
0
3814} -
3815 -
3816 -
3817static HB_Error Lookup_ContextPos3( GPOS_Instance* gpi, -
3818 HB_ContextPosFormat3* cpf3, -
3819 HB_Buffer buffer, -
3820 HB_UShort flags, -
3821 HB_UShort context_length, -
3822 int nesting_level ) -
3823{ -
3824 HB_Error error; -
3825 HB_UShort index, i, j, property; -
3826 HB_GPOSHeader* gpos = gpi->gpos; -
3827 -
3828 HB_Coverage* c; -
3829 HB_GDEFHeader* gdef; -
3830 -
3831 -
3832 gdef = gpos->gdef; -
3833 -
3834 if ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
0
3835 return error;
never executed: return error;
0
3836 -
3837 if ( context_length != 0xFFFF && context_length < cpf3->GlyphCount )
never evaluated: context_length != 0xFFFF
never evaluated: context_length < cpf3->GlyphCount
0
3838 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3839 -
3840 if ( buffer->in_pos + cpf3->GlyphCount > buffer->in_length )
never evaluated: buffer->in_pos + cpf3->GlyphCount > buffer->in_length
0
3841 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3842 -
3843 c = cpf3->Coverage; -
3844 -
3845 for ( i = 1, j = 1; i < cpf3->GlyphCount; i++, j++ )
never evaluated: i < cpf3->GlyphCount
0
3846 { -
3847 while ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
3848 { -
3849 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3850 return error;
never executed: return error;
0
3851 -
3852 if ( j + cpf3->GlyphCount - i == (HB_Int)buffer->in_length )
never evaluated: j + cpf3->GlyphCount - i == (HB_Int)buffer->in_length
0
3853 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3854 j++; -
3855 }
never executed: }
0
3856 -
3857 error = _HB_OPEN_Coverage_Index( &c[i], (buffer->in_string[(j)].gindex), &index ); -
3858 if ( error )
never evaluated: error
0
3859 return error;
never executed: return error;
0
3860 }
never executed: }
0
3861 -
3862 return Do_ContextPos( gpi, cpf3->GlyphCount, 0
3863 cpf3->PosCount, cpf3->PosLookupRecord, 0
3864 buffer, 0
3865 nesting_level );
never executed: return Do_ContextPos( gpi, cpf3->GlyphCount, cpf3->PosCount, cpf3->PosLookupRecord, buffer, nesting_level );
0
3866} -
3867 -
3868 -
3869static HB_Error Lookup_ContextPos( GPOS_Instance* gpi, -
3870 HB_GPOS_SubTable* st, -
3871 HB_Buffer buffer, -
3872 HB_UShort flags, -
3873 HB_UShort context_length, -
3874 int nesting_level ) -
3875{ -
3876 HB_ContextPos* cp = &st->context; -
3877 -
3878 switch ( cp->PosFormat ) -
3879 { -
3880 case 1: -
3881 return Lookup_ContextPos1( gpi, &cp->cpf.cpf1, buffer, 0
3882 flags, context_length, nesting_level );
never executed: return Lookup_ContextPos1( gpi, &cp->cpf.cpf1, buffer, flags, context_length, nesting_level );
0
3883 -
3884 case 2: -
3885 return Lookup_ContextPos2( gpi, &cp->cpf.cpf2, buffer, 0
3886 flags, context_length, nesting_level );
never executed: return Lookup_ContextPos2( gpi, &cp->cpf.cpf2, buffer, flags, context_length, nesting_level );
0
3887 -
3888 case 3: -
3889 return Lookup_ContextPos3( gpi, &cp->cpf.cpf3, buffer, 0
3890 flags, context_length, nesting_level );
never executed: return Lookup_ContextPos3( gpi, &cp->cpf.cpf3, buffer, flags, context_length, nesting_level );
0
3891 -
3892 default: -
3893 return _hb_err (HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
3894 } -
3895 -
3896 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
3897} -
3898 -
3899 -
3900 -
3901 -
3902 -
3903 -
3904static HB_Error Load_ChainPosRule( HB_ChainPosRule* cpr, -
3905 HB_Stream stream ) -
3906{ -
3907 HB_Error error; -
3908 -
3909 HB_UShort n, count; -
3910 HB_UShort* b; -
3911 HB_UShort* i; -
3912 HB_UShort* l; -
3913 -
3914 HB_PosLookupRecord* plr; -
3915 -
3916 -
3917 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3918 return error;
never executed: return error;
0
3919 -
3920 cpr->BacktrackGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
3921 -
3922 _hb_stream_frame_exit( stream ); -
3923 -
3924 cpr->Backtrack = ((void *)0); -
3925 -
3926 count = cpr->BacktrackGlyphCount; -
3927 -
3928 if ( ( (cpr->Backtrack) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
never evaluated: ( (cpr->Backtrack) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
0
3929 return error;
never executed: return error;
0
3930 -
3931 b = cpr->Backtrack; -
3932 -
3933 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
0
3934 goto Fail4;
never executed: goto Fail4;
0
3935 -
3936 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
3937 b[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
never executed: b[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
0
3938 -
3939 _hb_stream_frame_exit( stream ); -
3940 -
3941 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3942 goto Fail4;
never executed: goto Fail4;
0
3943 -
3944 cpr->InputGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
3945 -
3946 _hb_stream_frame_exit( stream ); -
3947 -
3948 cpr->Input = ((void *)0); -
3949 -
3950 count = cpr->InputGlyphCount - 1; -
3951 -
3952 if ( ( (cpr->Input) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
never evaluated: ( (cpr->Input) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
0
3953 goto Fail4;
never executed: goto Fail4;
0
3954 -
3955 i = cpr->Input; -
3956 -
3957 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
0
3958 goto Fail3;
never executed: goto Fail3;
0
3959 -
3960 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
3961 i[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
never executed: i[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
0
3962 -
3963 _hb_stream_frame_exit( stream ); -
3964 -
3965 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3966 goto Fail3;
never executed: goto Fail3;
0
3967 -
3968 cpr->LookaheadGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
3969 -
3970 _hb_stream_frame_exit( stream ); -
3971 -
3972 cpr->Lookahead = ((void *)0); -
3973 -
3974 count = cpr->LookaheadGlyphCount; -
3975 -
3976 if ( ( (cpr->Lookahead) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
never evaluated: ( (cpr->Lookahead) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
0
3977 goto Fail3;
never executed: goto Fail3;
0
3978 -
3979 l = cpr->Lookahead; -
3980 -
3981 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
0
3982 goto Fail2;
never executed: goto Fail2;
0
3983 -
3984 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
3985 l[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
never executed: l[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
0
3986 -
3987 _hb_stream_frame_exit( stream ); -
3988 -
3989 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3990 goto Fail2;
never executed: goto Fail2;
0
3991 -
3992 cpr->PosCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
3993 -
3994 _hb_stream_frame_exit( stream ); -
3995 -
3996 cpr->PosLookupRecord = ((void *)0); -
3997 -
3998 count = cpr->PosCount; -
3999 -
4000 if ( ( (cpr->PosLookupRecord) = _hb_alloc( (count)*sizeof(HB_PosLookupRecord), &error ), error != 0 ) )
never evaluated: ( (cpr->PosLookupRecord) = _hb_alloc( (count)*sizeof(HB_PosLookupRecord), &error ), error != 0 )
0
4001 goto Fail2;
never executed: goto Fail2;
0
4002 -
4003 plr = cpr->PosLookupRecord; -
4004 -
4005 if ( ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 )
0
4006 goto Fail1;
never executed: goto Fail1;
0
4007 -
4008 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
4009 { -
4010 plr[n].SequenceIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
4011 plr[n].LookupListIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
4012 }
never executed: }
0
4013 -
4014 _hb_stream_frame_exit( stream ); -
4015 -
4016 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
4017 -
4018Fail1: -
4019 do { if ( (plr) ) { _hb_free( plr ); plr = ((void *)0); } } while (0);
never evaluated: (plr)
never evaluated: 0
never executed: }
never executed: }
0
4020 -
4021Fail2:
code before this statement never executed: Fail2:
0
4022 do { if ( (l) ) { _hb_free( l ); l = ((void *)0); } } while (0);
never evaluated: (l)
never evaluated: 0
never executed: }
never executed: }
0
4023 -
4024Fail3:
code before this statement never executed: Fail3:
0
4025 do { if ( (i) ) { _hb_free( i ); i = ((void *)0); } } while (0);
never evaluated: (i)
never evaluated: 0
never executed: }
never executed: }
0
4026 -
4027Fail4:
code before this statement never executed: Fail4:
0
4028 do { if ( (b) ) { _hb_free( b ); b = ((void *)0); } } while (0);
never evaluated: (b)
never evaluated: 0
never executed: }
never executed: }
0
4029 return error;
never executed: return error;
0
4030} -
4031 -
4032 -
4033static void Free_ChainPosRule( HB_ChainPosRule* cpr ) -
4034{ -
4035 do { if ( (cpr->PosLookupRecord) ) { _hb_free( cpr->PosLookupRecord ); cpr->PosLookupRecord = ((void *)0); } } while (0);
never evaluated: (cpr->PosLookupRecord)
never evaluated: 0
never executed: }
never executed: }
0
4036 do { if ( (cpr->Lookahead) ) { _hb_free( cpr->Lookahead ); cpr->Lookahead = ((void *)0); } } while (0);
never evaluated: (cpr->Lookahead)
never evaluated: 0
never executed: }
never executed: }
0
4037 do { if ( (cpr->Input) ) { _hb_free( cpr->Input ); cpr->Input = ((void *)0); } } while (0);
never evaluated: (cpr->Input)
never evaluated: 0
never executed: }
never executed: }
0
4038 do { if ( (cpr->Backtrack) ) { _hb_free( cpr->Backtrack ); cpr->Backtrack = ((void *)0); } } while (0);
never evaluated: (cpr->Backtrack)
never evaluated: 0
never executed: }
never executed: }
0
4039}
never executed: }
0
4040 -
4041 -
4042 -
4043 -
4044static HB_Error Load_ChainPosRuleSet( HB_ChainPosRuleSet* cprs, -
4045 HB_Stream stream ) -
4046{ -
4047 HB_Error error; -
4048 -
4049 HB_UShort n, m, count; -
4050 HB_UInt cur_offset, new_offset, base_offset; -
4051 -
4052 HB_ChainPosRule* cpr; -
4053 -
4054 -
4055 base_offset = _hb_stream_pos( stream ); -
4056 -
4057 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
4058 return error;
never executed: return error;
0
4059 -
4060 count = cprs->ChainPosRuleCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
4061 -
4062 _hb_stream_frame_exit( stream ); -
4063 -
4064 cprs->ChainPosRule = ((void *)0); -
4065 -
4066 if ( ( (cprs->ChainPosRule) = _hb_alloc( (count)*sizeof(HB_ChainPosRule), &error ), error != 0 ) )
never evaluated: ( (cprs->ChainPosRule) = _hb_alloc( (count)*sizeof(HB_ChainPosRule), &error ), error != 0 )
0
4067 return error;
never executed: return error;
0
4068 -
4069 cpr = cprs->ChainPosRule; -
4070 -
4071 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
4072 { -
4073 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
4074 goto Fail;
never executed: goto Fail;
0
4075 -
4076 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
4077 -
4078 _hb_stream_frame_exit( stream ); -
4079 -
4080 cur_offset = _hb_stream_pos( stream ); -
4081 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
4082 ( error = Load_ChainPosRule( &cpr[n], stream ) ) != HB_Err_Ok )
never evaluated: ( error = Load_ChainPosRule( &cpr[n], stream ) ) != HB_Err_Ok
0
4083 goto Fail;
never executed: goto Fail;
0
4084 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
4085 }
never executed: }
0
4086 -
4087 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
4088 -
4089Fail: -
4090 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
4091 Free_ChainPosRule( &cpr[m] );
never executed: Free_ChainPosRule( &cpr[m] );
0
4092 -
4093 do { if ( (cpr) ) { _hb_free( cpr ); cpr = ((void *)0); } } while (0);
never evaluated: (cpr)
never evaluated: 0
never executed: }
never executed: }
0
4094 return error;
never executed: return error;
0
4095} -
4096 -
4097 -
4098static void Free_ChainPosRuleSet( HB_ChainPosRuleSet* cprs ) -
4099{ -
4100 HB_UShort n, count; -
4101 -
4102 HB_ChainPosRule* cpr; -
4103 -
4104 -
4105 if ( cprs->ChainPosRule )
never evaluated: cprs->ChainPosRule
0
4106 { -
4107 count = cprs->ChainPosRuleCount; -
4108 cpr = cprs->ChainPosRule; -
4109 -
4110 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
4111 Free_ChainPosRule( &cpr[n] );
never executed: Free_ChainPosRule( &cpr[n] );
0
4112 -
4113 do { if ( (cpr) ) { _hb_free( cpr ); cpr = ((void *)0); } } while (0);
never evaluated: (cpr)
never evaluated: 0
never executed: }
never executed: }
0
4114 }
never executed: }
0
4115}
never executed: }
0
4116 -
4117 -
4118 -
4119 -
4120static HB_Error Load_ChainContextPos1( HB_ChainContextPosFormat1* ccpf1, -
4121 HB_Stream stream ) -
4122{ -
4123 HB_Error error; -
4124 -
4125 HB_UShort n, m, count; -
4126 HB_UInt cur_offset, new_offset, base_offset; -
4127 -
4128 HB_ChainPosRuleSet* cprs; -
4129 -
4130 -
4131 base_offset = _hb_stream_pos( stream ) - 2L; -
4132 -
4133 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
4134 return error;
never executed: return error;
0
4135 -
4136 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
4137 -
4138 _hb_stream_frame_exit( stream ); -
4139 -
4140 cur_offset = _hb_stream_pos( stream ); -
4141 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
4142 ( error = _HB_OPEN_Load_Coverage( &ccpf1->Coverage, stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Coverage( &ccpf1->Coverage, stream ) ) != HB_Err_Ok
0
4143 return error;
never executed: return error;
0
4144 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
4145 -
4146 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
4147 goto Fail2;
never executed: goto Fail2;
0
4148 -
4149 count = ccpf1->ChainPosRuleSetCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
4150 -
4151 _hb_stream_frame_exit( stream ); -
4152 -
4153 ccpf1->ChainPosRuleSet = ((void *)0); -
4154 -
4155 if ( ( (ccpf1->ChainPosRuleSet) = _hb_alloc( (count)*sizeof(HB_ChainPosRuleSet), &error ), error != 0 ) )
never evaluated: ( (ccpf1->ChainPosRuleSet) = _hb_alloc( (count)*sizeof(HB_ChainPosRuleSet), &error ), error != 0 )
0
4156 goto Fail2;
never executed: goto Fail2;
0
4157 -
4158 cprs = ccpf1->ChainPosRuleSet; -
4159 -
4160 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
4161 { -
4162 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
4163 goto Fail1;
never executed: goto Fail1;
0
4164 -
4165 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
4166 -
4167 _hb_stream_frame_exit( stream ); -
4168 -
4169 cur_offset = _hb_stream_pos( stream ); -
4170 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
4171 ( error = Load_ChainPosRuleSet( &cprs[n], stream ) ) != HB_Err_Ok )
never evaluated: ( error = Load_ChainPosRuleSet( &cprs[n], stream ) ) != HB_Err_Ok
0
4172 goto Fail1;
never executed: goto Fail1;
0
4173 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
4174 }
never executed: }
0
4175 -
4176 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
4177 -
4178Fail1: -
4179 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
4180 Free_ChainPosRuleSet( &cprs[m] );
never executed: Free_ChainPosRuleSet( &cprs[m] );
0
4181 -
4182 do { if ( (cprs) ) { _hb_free( cprs ); cprs = ((void *)0); } } while (0);
never evaluated: (cprs)
never evaluated: 0
never executed: }
never executed: }
0
4183 -
4184Fail2:
code before this statement never executed: Fail2:
0
4185 _HB_OPEN_Free_Coverage( &ccpf1->Coverage ); -
4186 return error;
never executed: return error;
0
4187} -
4188 -
4189 -
4190static void Free_ChainContextPos1( HB_ChainContextPosFormat1* ccpf1 ) -
4191{ -
4192 HB_UShort n, count; -
4193 -
4194 HB_ChainPosRuleSet* cprs; -
4195 -
4196 -
4197 if ( ccpf1->ChainPosRuleSet )
never evaluated: ccpf1->ChainPosRuleSet
0
4198 { -
4199 count = ccpf1->ChainPosRuleSetCount; -
4200 cprs = ccpf1->ChainPosRuleSet; -
4201 -
4202 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
4203 Free_ChainPosRuleSet( &cprs[n] );
never executed: Free_ChainPosRuleSet( &cprs[n] );
0
4204 -
4205 do { if ( (cprs) ) { _hb_free( cprs ); cprs = ((void *)0); } } while (0);
never evaluated: (cprs)
never evaluated: 0
never executed: }
never executed: }
0
4206 }
never executed: }
0
4207 -
4208 _HB_OPEN_Free_Coverage( &ccpf1->Coverage ); -
4209}
never executed: }
0
4210 -
4211 -
4212 -
4213 -
4214static HB_Error Load_ChainPosClassRule( -
4215 HB_ChainContextPosFormat2* ccpf2, -
4216 HB_ChainPosClassRule* cpcr, -
4217 HB_Stream stream ) -
4218{ -
4219 HB_Error error; -
4220 -
4221 HB_UShort n, count; -
4222 -
4223 HB_UShort* b; -
4224 HB_UShort* i; -
4225 HB_UShort* l; -
4226 HB_PosLookupRecord* plr; -
4227 -
4228 -
4229 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
4230 return error;
never executed: return error;
0
4231 -
4232 cpcr->BacktrackGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
4233 -
4234 _hb_stream_frame_exit( stream ); -
4235 -
4236 if ( cpcr->BacktrackGlyphCount > ccpf2->MaxBacktrackLength )
never evaluated: cpcr->BacktrackGlyphCount > ccpf2->MaxBacktrackLength
0
4237 ccpf2->MaxBacktrackLength = cpcr->BacktrackGlyphCount;
never executed: ccpf2->MaxBacktrackLength = cpcr->BacktrackGlyphCount;
0
4238 -
4239 cpcr->Backtrack = ((void *)0); -
4240 -
4241 count = cpcr->BacktrackGlyphCount; -
4242 -
4243 if ( ( (cpcr->Backtrack) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
never evaluated: ( (cpcr->Backtrack) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
0
4244 return error;
never executed: return error;
0
4245 -
4246 b = cpcr->Backtrack; -
4247 -
4248 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
0
4249 goto Fail4;
never executed: goto Fail4;
0
4250 -
4251 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
4252 b[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
never executed: b[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
0
4253 -
4254 _hb_stream_frame_exit( stream ); -
4255 -
4256 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
4257 goto Fail4;
never executed: goto Fail4;
0
4258 -
4259 cpcr->InputGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
4260 -
4261 if ( cpcr->InputGlyphCount > ccpf2->MaxInputLength )
never evaluated: cpcr->InputGlyphCount > ccpf2->MaxInputLength
0
4262 ccpf2->MaxInputLength = cpcr->InputGlyphCount;
never executed: ccpf2->MaxInputLength = cpcr->InputGlyphCount;
0
4263 -
4264 _hb_stream_frame_exit( stream ); -
4265 -
4266 cpcr->Input = ((void *)0); -
4267 -
4268 count = cpcr->InputGlyphCount - 1; -
4269 -
4270 if ( ( (cpcr->Input) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
never evaluated: ( (cpcr->Input) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
0
4271 goto Fail4;
never executed: goto Fail4;
0
4272 -
4273 i = cpcr->Input; -
4274 -
4275 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
0
4276 goto Fail3;
never executed: goto Fail3;
0
4277 -
4278 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
4279 i[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
never executed: i[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
0
4280 -
4281 _hb_stream_frame_exit( stream ); -
4282 -
4283 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
4284 goto Fail3;
never executed: goto Fail3;
0
4285 -
4286 cpcr->LookaheadGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
4287 -
4288 _hb_stream_frame_exit( stream ); -
4289 -
4290 if ( cpcr->LookaheadGlyphCount > ccpf2->MaxLookaheadLength )
never evaluated: cpcr->LookaheadGlyphCount > ccpf2->MaxLookaheadLength
0
4291 ccpf2->MaxLookaheadLength = cpcr->LookaheadGlyphCount;
never executed: ccpf2->MaxLookaheadLength = cpcr->LookaheadGlyphCount;
0
4292 -
4293 cpcr->Lookahead = ((void *)0); -
4294 -
4295 count = cpcr->LookaheadGlyphCount; -
4296 -
4297 if ( ( (cpcr->Lookahead) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
never evaluated: ( (cpcr->Lookahead) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
0
4298 goto Fail3;
never executed: goto Fail3;
0
4299 -
4300 l = cpcr->Lookahead; -
4301 -
4302 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
0
4303 goto Fail2;
never executed: goto Fail2;
0
4304 -
4305 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
4306 l[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
never executed: l[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
0
4307 -
4308 _hb_stream_frame_exit( stream ); -
4309 -
4310 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
4311 goto Fail2;
never executed: goto Fail2;
0
4312 -
4313 cpcr->PosCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
4314 -
4315 _hb_stream_frame_exit( stream ); -
4316 -
4317 cpcr->PosLookupRecord = ((void *)0); -
4318 -
4319 count = cpcr->PosCount; -
4320 -
4321 if ( ( (cpcr->PosLookupRecord) = _hb_alloc( (count)*sizeof(HB_PosLookupRecord), &error ), error != 0 ) )
never evaluated: ( (cpcr->PosLookupRecord) = _hb_alloc( (count)*sizeof(HB_PosLookupRecord), &error ), error != 0 )
0
4322 goto Fail2;
never executed: goto Fail2;
0
4323 -
4324 plr = cpcr->PosLookupRecord; -
4325 -
4326 if ( ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 )
0
4327 goto Fail1;
never executed: goto Fail1;
0
4328 -
4329 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
4330 { -
4331 plr[n].SequenceIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
4332 plr[n].LookupListIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
4333 }
never executed: }
0
4334 -
4335 _hb_stream_frame_exit( stream ); -
4336 -
4337 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
4338 -
4339Fail1: -
4340 do { if ( (plr) ) { _hb_free( plr ); plr = ((void *)0); } } while (0);
never evaluated: (plr)
never evaluated: 0
never executed: }
never executed: }
0
4341 -
4342Fail2:
code before this statement never executed: Fail2:
0
4343 do { if ( (l) ) { _hb_free( l ); l = ((void *)0); } } while (0);
never evaluated: (l)
never evaluated: 0
never executed: }
never executed: }
0
4344 -
4345Fail3:
code before this statement never executed: Fail3:
0
4346 do { if ( (i) ) { _hb_free( i ); i = ((void *)0); } } while (0);
never evaluated: (i)
never evaluated: 0
never executed: }
never executed: }
0
4347 -
4348Fail4:
code before this statement never executed: Fail4:
0
4349 do { if ( (b) ) { _hb_free( b ); b = ((void *)0); } } while (0);
never evaluated: (b)
never evaluated: 0
never executed: }
never executed: }
0
4350 return error;
never executed: return error;
0
4351} -
4352 -
4353 -
4354static void Free_ChainPosClassRule( HB_ChainPosClassRule* cpcr ) -
4355{ -
4356 do { if ( (cpcr->PosLookupRecord) ) { _hb_free( cpcr->PosLookupRecord ); cpcr->PosLookupRecord = ((void *)0); } } while (0);
never evaluated: (cpcr->PosLookupRecord)
never evaluated: 0
never executed: }
never executed: }
0
4357 do { if ( (cpcr->Lookahead) ) { _hb_free( cpcr->Lookahead ); cpcr->Lookahead = ((void *)0); } } while (0);
never evaluated: (cpcr->Lookahead)
never evaluated: 0
never executed: }
never executed: }
0
4358 do { if ( (cpcr->Input) ) { _hb_free( cpcr->Input ); cpcr->Input = ((void *)0); } } while (0);
never evaluated: (cpcr->Input)
never evaluated: 0
never executed: }
never executed: }
0
4359 do { if ( (cpcr->Backtrack) ) { _hb_free( cpcr->Backtrack ); cpcr->Backtrack = ((void *)0); } } while (0);
never evaluated: (cpcr->Backtrack)
never evaluated: 0
never executed: }
never executed: }
0
4360}
never executed: }
0
4361 -
4362 -
4363 -
4364 -
4365static HB_Error Load_ChainPosClassSet( -
4366 HB_ChainContextPosFormat2* ccpf2, -
4367 HB_ChainPosClassSet* cpcs, -
4368 HB_Stream stream ) -
4369{ -
4370 HB_Error error; -
4371 -
4372 HB_UShort n, m, count; -
4373 HB_UInt cur_offset, new_offset, base_offset; -
4374 -
4375 HB_ChainPosClassRule* cpcr; -
4376 -
4377 -
4378 base_offset = _hb_stream_pos( stream ); -
4379 -
4380 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
4381 return error;
never executed: return error;
0
4382 -
4383 count = cpcs->ChainPosClassRuleCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
4384 -
4385 _hb_stream_frame_exit( stream ); -
4386 -
4387 cpcs->ChainPosClassRule = ((void *)0); -
4388 -
4389 if ( ( (cpcs->ChainPosClassRule) = _hb_alloc( (count)*sizeof(HB_ChainPosClassRule), &error ), error != 0 ) )
never evaluated: ( (cpcs->ChainPosClassRule) = _hb_alloc( (count)*sizeof(HB_ChainPosClassRule), &error ), error != 0 )
0
4390 -
4391 return error;
never executed: return error;
0
4392 -
4393 cpcr = cpcs->ChainPosClassRule; -
4394 -
4395 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
4396 { -
4397 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
4398 goto Fail;
never executed: goto Fail;
0
4399 -
4400 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
4401 -
4402 _hb_stream_frame_exit( stream ); -
4403 -
4404 cur_offset = _hb_stream_pos( stream ); -
4405 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
4406 ( error = Load_ChainPosClassRule( ccpf2, &cpcr[n], 0
4407 stream ) ) != HB_Err_Ok )
never evaluated: ( error = Load_ChainPosClassRule( ccpf2, &cpcr[n], stream ) ) != HB_Err_Ok
0
4408 goto Fail;
never executed: goto Fail;
0
4409 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
4410 }
never executed: }
0
4411 -
4412 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
4413 -
4414Fail: -
4415 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
4416 Free_ChainPosClassRule( &cpcr[m] );
never executed: Free_ChainPosClassRule( &cpcr[m] );
0
4417 -
4418 do { if ( (cpcr) ) { _hb_free( cpcr ); cpcr = ((void *)0); } } while (0);
never evaluated: (cpcr)
never evaluated: 0
never executed: }
never executed: }
0
4419 return error;
never executed: return error;
0
4420} -
4421 -
4422 -
4423static void Free_ChainPosClassSet( HB_ChainPosClassSet* cpcs ) -
4424{ -
4425 HB_UShort n, count; -
4426 -
4427 HB_ChainPosClassRule* cpcr; -
4428 -
4429 -
4430 if ( cpcs->ChainPosClassRule )
never evaluated: cpcs->ChainPosClassRule
0
4431 { -
4432 count = cpcs->ChainPosClassRuleCount; -
4433 cpcr = cpcs->ChainPosClassRule; -
4434 -
4435 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
4436 Free_ChainPosClassRule( &cpcr[n] );
never executed: Free_ChainPosClassRule( &cpcr[n] );
0
4437 -
4438 do { if ( (cpcr) ) { _hb_free( cpcr ); cpcr = ((void *)0); } } while (0);
never evaluated: (cpcr)
never evaluated: 0
never executed: }
never executed: }
0
4439 }
never executed: }
0
4440}
never executed: }
0
4441 -
4442 -
4443 -
4444 -
4445static HB_Error Load_ChainContextPos2( HB_ChainContextPosFormat2* ccpf2, -
4446 HB_Stream stream ) -
4447{ -
4448 HB_Error error; -
4449 -
4450 HB_UShort n, m, count; -
4451 HB_UInt cur_offset, new_offset, base_offset; -
4452 HB_UInt backtrack_offset, input_offset, lookahead_offset; -
4453 -
4454 HB_ChainPosClassSet* cpcs; -
4455 -
4456 -
4457 base_offset = _hb_stream_pos( stream ) - 2; -
4458 -
4459 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
4460 return error;
never executed: return error;
0
4461 -
4462 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
4463 -
4464 _hb_stream_frame_exit( stream ); -
4465 -
4466 cur_offset = _hb_stream_pos( stream ); -
4467 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
4468 ( error = _HB_OPEN_Load_Coverage( &ccpf2->Coverage, stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Coverage( &ccpf2->Coverage, stream ) ) != HB_Err_Ok
0
4469 return error;
never executed: return error;
0
4470 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
4471 -
4472 if ( ( (error = (_hb_stream_frame_enter( stream, 8L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 8L ))) != 0 )
0
4473 goto Fail5;
never executed: goto Fail5;
0
4474 -
4475 backtrack_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
4476 input_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
4477 lookahead_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
4478 -
4479 -
4480 -
4481 -
4482 -
4483 count = ccpf2->ChainPosClassSetCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
4484 -
4485 _hb_stream_frame_exit( stream ); -
4486 -
4487 if ( ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccpf2->BacktrackClassDef, 65535, 0
4488 backtrack_offset, base_offset, 0
4489 stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccpf2->BacktrackClassDef, 65535, backtrack_offset, base_offset, stream ) ) != HB_Err_Ok
0
4490 goto Fail5;
never executed: goto Fail5;
0
4491 if ( ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccpf2->InputClassDef, count, 0
4492 input_offset, base_offset, 0
4493 stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccpf2->InputClassDef, count, input_offset, base_offset, stream ) ) != HB_Err_Ok
0
4494 goto Fail4;
never executed: goto Fail4;
0
4495 if ( ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccpf2->LookaheadClassDef, 65535, 0
4496 lookahead_offset, base_offset, 0
4497 stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccpf2->LookaheadClassDef, 65535, lookahead_offset, base_offset, stream ) ) != HB_Err_Ok
0
4498 goto Fail3;
never executed: goto Fail3;
0
4499 -
4500 ccpf2->ChainPosClassSet = ((void *)0); -
4501 ccpf2->MaxBacktrackLength = 0; -
4502 ccpf2->MaxInputLength = 0; -
4503 ccpf2->MaxLookaheadLength = 0; -
4504 -
4505 if ( ( (ccpf2->ChainPosClassSet) = _hb_alloc( (count)*sizeof(HB_ChainPosClassSet), &error ), error != 0 ) )
never evaluated: ( (ccpf2->ChainPosClassSet) = _hb_alloc( (count)*sizeof(HB_ChainPosClassSet), &error ), error != 0 )
0
4506 goto Fail2;
never executed: goto Fail2;
0
4507 -
4508 cpcs = ccpf2->ChainPosClassSet; -
4509 -
4510 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
4511 { -
4512 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
4513 goto Fail1;
never executed: goto Fail1;
0
4514 -
4515 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
4516 -
4517 _hb_stream_frame_exit( stream ); -
4518 -
4519 if ( new_offset != base_offset )
never evaluated: new_offset != base_offset
0
4520 { -
4521 cur_offset = _hb_stream_pos( stream ); -
4522 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
4523 ( error = Load_ChainPosClassSet( ccpf2, &cpcs[n], 0
4524 stream ) ) != HB_Err_Ok )
never evaluated: ( error = Load_ChainPosClassSet( ccpf2, &cpcs[n], stream ) ) != HB_Err_Ok
0
4525 goto Fail1;
never executed: goto Fail1;
0
4526 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
4527 }
never executed: }
0
4528 else -
4529 { -
4530 -
4531 -
4532 ccpf2->ChainPosClassSet[n].ChainPosClassRuleCount = 0; -
4533 ccpf2->ChainPosClassSet[n].ChainPosClassRule = ((void *)0); -
4534 }
never executed: }
0
4535 } -
4536 -
4537 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
4538 -
4539Fail1: -
4540 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
4541 Free_ChainPosClassSet( &cpcs[m] );
never executed: Free_ChainPosClassSet( &cpcs[m] );
0
4542 -
4543 do { if ( (cpcs) ) { _hb_free( cpcs ); cpcs = ((void *)0); } } while (0);
never evaluated: (cpcs)
never evaluated: 0
never executed: }
never executed: }
0
4544 -
4545Fail2:
code before this statement never executed: Fail2:
0
4546 _HB_OPEN_Free_ClassDefinition( &ccpf2->LookaheadClassDef ); -
4547 -
4548Fail3:
code before this statement never executed: Fail3:
0
4549 _HB_OPEN_Free_ClassDefinition( &ccpf2->InputClassDef ); -
4550 -
4551Fail4:
code before this statement never executed: Fail4:
0
4552 _HB_OPEN_Free_ClassDefinition( &ccpf2->BacktrackClassDef ); -
4553 -
4554Fail5:
code before this statement never executed: Fail5:
0
4555 _HB_OPEN_Free_Coverage( &ccpf2->Coverage ); -
4556 return error;
never executed: return error;
0
4557} -
4558 -
4559 -
4560static void Free_ChainContextPos2( HB_ChainContextPosFormat2* ccpf2 ) -
4561{ -
4562 HB_UShort n, count; -
4563 -
4564 HB_ChainPosClassSet* cpcs; -
4565 -
4566 -
4567 if ( ccpf2->ChainPosClassSet )
never evaluated: ccpf2->ChainPosClassSet
0
4568 { -
4569 count = ccpf2->ChainPosClassSetCount; -
4570 cpcs = ccpf2->ChainPosClassSet; -
4571 -
4572 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
4573 Free_ChainPosClassSet( &cpcs[n] );
never executed: Free_ChainPosClassSet( &cpcs[n] );
0
4574 -
4575 do { if ( (cpcs) ) { _hb_free( cpcs ); cpcs = ((void *)0); } } while (0);
never evaluated: (cpcs)
never evaluated: 0
never executed: }
never executed: }
0
4576 }
never executed: }
0
4577 -
4578 _HB_OPEN_Free_ClassDefinition( &ccpf2->LookaheadClassDef ); -
4579 _HB_OPEN_Free_ClassDefinition( &ccpf2->InputClassDef ); -
4580 _HB_OPEN_Free_ClassDefinition( &ccpf2->BacktrackClassDef ); -
4581 -
4582 _HB_OPEN_Free_Coverage( &ccpf2->Coverage ); -
4583}
never executed: }
0
4584 -
4585 -
4586 -
4587 -
4588static HB_Error Load_ChainContextPos3( HB_ChainContextPosFormat3* ccpf3, -
4589 HB_Stream stream ) -
4590{ -
4591 HB_Error error; -
4592 -
4593 HB_UShort n, nb, ni, nl, m, count; -
4594 HB_UShort backtrack_count, input_count, lookahead_count; -
4595 HB_UInt cur_offset, new_offset, base_offset; -
4596 -
4597 HB_Coverage* b; -
4598 HB_Coverage* i; -
4599 HB_Coverage* l; -
4600 HB_PosLookupRecord* plr; -
4601 -
4602 -
4603 base_offset = _hb_stream_pos( stream ) - 2L; -
4604 -
4605 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
4606 return error;
never executed: return error;
0
4607 -
4608 ccpf3->BacktrackGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
4609 -
4610 _hb_stream_frame_exit( stream ); -
4611 -
4612 ccpf3->BacktrackCoverage = ((void *)0); -
4613 -
4614 backtrack_count = ccpf3->BacktrackGlyphCount; -
4615 -
4616 if ( ( (ccpf3->BacktrackCoverage) = _hb_alloc( (backtrack_count)*sizeof(HB_Coverage), &error ), error != 0 ) )
never evaluated: ( (ccpf3->BacktrackCoverage) = _hb_alloc( (backtrack_count)*sizeof(HB_Coverage), &error ), error != 0 )
0
4617 -
4618 return error;
never executed: return error;
0
4619 -
4620 b = ccpf3->BacktrackCoverage; -
4621 -
4622 for ( nb = 0; nb < backtrack_count; nb++ )
never evaluated: nb < backtrack_count
0
4623 { -
4624 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
4625 goto Fail4;
never executed: goto Fail4;
0
4626 -
4627 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
4628 -
4629 _hb_stream_frame_exit( stream ); -
4630 -
4631 cur_offset = _hb_stream_pos( stream ); -
4632 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
4633 ( error = _HB_OPEN_Load_Coverage( &b[nb], stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Coverage( &b[nb], stream ) ) != HB_Err_Ok
0
4634 goto Fail4;
never executed: goto Fail4;
0
4635 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
4636 }
never executed: }
0
4637 -
4638 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
4639 goto Fail4;
never executed: goto Fail4;
0
4640 -
4641 ccpf3->InputGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
4642 -
4643 _hb_stream_frame_exit( stream ); -
4644 -
4645 ccpf3->InputCoverage = ((void *)0); -
4646 -
4647 input_count = ccpf3->InputGlyphCount; -
4648 -
4649 if ( ( (ccpf3->InputCoverage) = _hb_alloc( (input_count)*sizeof(HB_Coverage), &error ), error != 0 ) )
never evaluated: ( (ccpf3->InputCoverage) = _hb_alloc( (input_count)*sizeof(HB_Coverage), &error ), error != 0 )
0
4650 goto Fail4;
never executed: goto Fail4;
0
4651 -
4652 i = ccpf3->InputCoverage; -
4653 -
4654 for ( ni = 0; ni < input_count; ni++ )
never evaluated: ni < input_count
0
4655 { -
4656 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
4657 goto Fail3;
never executed: goto Fail3;
0
4658 -
4659 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
4660 -
4661 _hb_stream_frame_exit( stream ); -
4662 -
4663 cur_offset = _hb_stream_pos( stream ); -
4664 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
4665 ( error = _HB_OPEN_Load_Coverage( &i[ni], stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Coverage( &i[ni], stream ) ) != HB_Err_Ok
0
4666 goto Fail3;
never executed: goto Fail3;
0
4667 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
4668 }
never executed: }
0
4669 -
4670 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
4671 goto Fail3;
never executed: goto Fail3;
0
4672 -
4673 ccpf3->LookaheadGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
4674 -
4675 _hb_stream_frame_exit( stream ); -
4676 -
4677 ccpf3->LookaheadCoverage = ((void *)0); -
4678 -
4679 lookahead_count = ccpf3->LookaheadGlyphCount; -
4680 -
4681 if ( ( (ccpf3->LookaheadCoverage) = _hb_alloc( (lookahead_count)*sizeof(HB_Coverage), &error ), error != 0 ) )
never evaluated: ( (ccpf3->LookaheadCoverage) = _hb_alloc( (lookahead_count)*sizeof(HB_Coverage), &error ), error != 0 )
0
4682 -
4683 goto Fail3;
never executed: goto Fail3;
0
4684 -
4685 l = ccpf3->LookaheadCoverage; -
4686 -
4687 for ( nl = 0; nl < lookahead_count; nl++ )
never evaluated: nl < lookahead_count
0
4688 { -
4689 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
4690 goto Fail2;
never executed: goto Fail2;
0
4691 -
4692 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
4693 -
4694 _hb_stream_frame_exit( stream ); -
4695 -
4696 cur_offset = _hb_stream_pos( stream ); -
4697 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
4698 ( error = _HB_OPEN_Load_Coverage( &l[nl], stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Coverage( &l[nl], stream ) ) != HB_Err_Ok
0
4699 goto Fail2;
never executed: goto Fail2;
0
4700 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
4701 }
never executed: }
0
4702 -
4703 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
4704 goto Fail2;
never executed: goto Fail2;
0
4705 -
4706 ccpf3->PosCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
4707 -
4708 _hb_stream_frame_exit( stream ); -
4709 -
4710 ccpf3->PosLookupRecord = ((void *)0); -
4711 -
4712 count = ccpf3->PosCount; -
4713 -
4714 if ( ( (ccpf3->PosLookupRecord) = _hb_alloc( (count)*sizeof(HB_PosLookupRecord), &error ), error != 0 ) )
never evaluated: ( (ccpf3->PosLookupRecord) = _hb_alloc( (count)*sizeof(HB_PosLookupRecord), &error ), error != 0 )
0
4715 goto Fail2;
never executed: goto Fail2;
0
4716 -
4717 plr = ccpf3->PosLookupRecord; -
4718 -
4719 if ( ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 )
0
4720 goto Fail1;
never executed: goto Fail1;
0
4721 -
4722 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
4723 { -
4724 plr[n].SequenceIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
4725 plr[n].LookupListIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
4726 }
never executed: }
0
4727 -
4728 _hb_stream_frame_exit( stream ); -
4729 -
4730 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
4731 -
4732Fail1: -
4733 do { if ( (plr) ) { _hb_free( plr ); plr = ((void *)0); } } while (0);
never evaluated: (plr)
never evaluated: 0
never executed: }
never executed: }
0
4734 -
4735Fail2:
code before this statement never executed: Fail2:
0
4736 for ( m = 0; m < nl; m++ )
never evaluated: m < nl
0
4737 _HB_OPEN_Free_Coverage( &l[m] );
never executed: _HB_OPEN_Free_Coverage( &l[m] );
0
4738 -
4739 do { if ( (l) ) { _hb_free( l ); l = ((void *)0); } } while (0);
never evaluated: (l)
never evaluated: 0
never executed: }
never executed: }
0
4740 -
4741Fail3:
code before this statement never executed: Fail3:
0
4742 for ( m = 0; m < ni; m++ )
never evaluated: m < ni
0
4743 _HB_OPEN_Free_Coverage( &i[m] );
never executed: _HB_OPEN_Free_Coverage( &i[m] );
0
4744 -
4745 do { if ( (i) ) { _hb_free( i ); i = ((void *)0); } } while (0);
never evaluated: (i)
never evaluated: 0
never executed: }
never executed: }
0
4746 -
4747Fail4:
code before this statement never executed: Fail4:
0
4748 for ( m = 0; m < nb; m++ )
never evaluated: m < nb
0
4749 _HB_OPEN_Free_Coverage( &b[m] );
never executed: _HB_OPEN_Free_Coverage( &b[m] );
0
4750 -
4751 do { if ( (b) ) { _hb_free( b ); b = ((void *)0); } } while (0);
never evaluated: (b)
never evaluated: 0
never executed: }
never executed: }
0
4752 return error;
never executed: return error;
0
4753} -
4754 -
4755 -
4756static void Free_ChainContextPos3( HB_ChainContextPosFormat3* ccpf3 ) -
4757{ -
4758 HB_UShort n, count; -
4759 -
4760 HB_Coverage* c; -
4761 -
4762 -
4763 do { if ( (ccpf3->PosLookupRecord) ) { _hb_free( ccpf3->PosLookupRecord ); ccpf3->PosLookupRecord = ((void *)0); } } while (0);
never evaluated: (ccpf3->PosLookupRecord)
never evaluated: 0
never executed: }
never executed: }
0
4764 -
4765 if ( ccpf3->LookaheadCoverage )
never evaluated: ccpf3->LookaheadCoverage
0
4766 { -
4767 count = ccpf3->LookaheadGlyphCount; -
4768 c = ccpf3->LookaheadCoverage; -
4769 -
4770 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
4771 _HB_OPEN_Free_Coverage( &c[n] );
never executed: _HB_OPEN_Free_Coverage( &c[n] );
0
4772 -
4773 do { if ( (c) ) { _hb_free( c ); c = ((void *)0); } } while (0);
never evaluated: (c)
never evaluated: 0
never executed: }
never executed: }
0
4774 }
never executed: }
0
4775 -
4776 if ( ccpf3->InputCoverage )
never evaluated: ccpf3->InputCoverage
0
4777 { -
4778 count = ccpf3->InputGlyphCount; -
4779 c = ccpf3->InputCoverage; -
4780 -
4781 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
4782 _HB_OPEN_Free_Coverage( &c[n] );
never executed: _HB_OPEN_Free_Coverage( &c[n] );
0
4783 -
4784 do { if ( (c) ) { _hb_free( c ); c = ((void *)0); } } while (0);
never evaluated: (c)
never evaluated: 0
never executed: }
never executed: }
0
4785 }
never executed: }
0
4786 -
4787 if ( ccpf3->BacktrackCoverage )
never evaluated: ccpf3->BacktrackCoverage
0
4788 { -
4789 count = ccpf3->BacktrackGlyphCount; -
4790 c = ccpf3->BacktrackCoverage; -
4791 -
4792 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
4793 _HB_OPEN_Free_Coverage( &c[n] );
never executed: _HB_OPEN_Free_Coverage( &c[n] );
0
4794 -
4795 do { if ( (c) ) { _hb_free( c ); c = ((void *)0); } } while (0);
never evaluated: (c)
never evaluated: 0
never executed: }
never executed: }
0
4796 }
never executed: }
0
4797}
never executed: }
0
4798 -
4799 -
4800 -
4801 -
4802static HB_Error Load_ChainContextPos( HB_GPOS_SubTable* st, -
4803 HB_Stream stream ) -
4804{ -
4805 HB_Error error; -
4806 HB_ChainContextPos* ccp = &st->chain; -
4807 -
4808 -
4809 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
4810 return error;
never executed: return error;
0
4811 -
4812 ccp->PosFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
4813 -
4814 _hb_stream_frame_exit( stream ); -
4815 -
4816 switch ( ccp->PosFormat ) -
4817 { -
4818 case 1: -
4819 return Load_ChainContextPos1( &ccp->ccpf.ccpf1, stream );
never executed: return Load_ChainContextPos1( &ccp->ccpf.ccpf1, stream );
0
4820 -
4821 case 2: -
4822 return Load_ChainContextPos2( &ccp->ccpf.ccpf2, stream );
never executed: return Load_ChainContextPos2( &ccp->ccpf.ccpf2, stream );
0
4823 -
4824 case 3: -
4825 return Load_ChainContextPos3( &ccp->ccpf.ccpf3, stream );
never executed: return Load_ChainContextPos3( &ccp->ccpf.ccpf3, stream );
0
4826 -
4827 default: -
4828 return _hb_err (HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
4829 } -
4830 -
4831 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
4832} -
4833 -
4834 -
4835static void Free_ChainContextPos( HB_GPOS_SubTable* st ) -
4836{ -
4837 HB_ChainContextPos* ccp = &st->chain; -
4838 -
4839 switch ( ccp->PosFormat ) -
4840 { -
4841 case 1: Free_ChainContextPos1( &ccp->ccpf.ccpf1 ); break;
never executed: break;
0
4842 case 2: Free_ChainContextPos2( &ccp->ccpf.ccpf2 ); break;
never executed: break;
0
4843 case 3: Free_ChainContextPos3( &ccp->ccpf.ccpf3 ); break;
never executed: break;
0
4844 default: break;
never executed: break;
0
4845 } -
4846}
never executed: }
0
4847 -
4848 -
4849static HB_Error Lookup_ChainContextPos1( -
4850 GPOS_Instance* gpi, -
4851 HB_ChainContextPosFormat1* ccpf1, -
4852 HB_Buffer buffer, -
4853 HB_UShort flags, -
4854 HB_UShort context_length, -
4855 int nesting_level ) -
4856{ -
4857 HB_UShort index, property; -
4858 HB_UShort i, j, k, num_cpr; -
4859 HB_UShort bgc, igc, lgc; -
4860 HB_Error error; -
4861 HB_GPOSHeader* gpos = gpi->gpos; -
4862 -
4863 HB_ChainPosRule* cpr; -
4864 HB_ChainPosRule curr_cpr; -
4865 HB_GDEFHeader* gdef; -
4866 -
4867 -
4868 gdef = gpos->gdef; -
4869 -
4870 if ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
0
4871 return error;
never executed: return error;
0
4872 -
4873 error = _HB_OPEN_Coverage_Index( &ccpf1->Coverage, (buffer->in_string[buffer->in_pos].gindex), &index ); -
4874 if ( error )
never evaluated: error
0
4875 return error;
never executed: return error;
0
4876 -
4877 cpr = ccpf1->ChainPosRuleSet[index].ChainPosRule; -
4878 num_cpr = ccpf1->ChainPosRuleSet[index].ChainPosRuleCount; -
4879 -
4880 for ( k = 0; k < num_cpr; k++ )
never evaluated: k < num_cpr
0
4881 { -
4882 curr_cpr = cpr[k]; -
4883 bgc = curr_cpr.BacktrackGlyphCount; -
4884 igc = curr_cpr.InputGlyphCount; -
4885 lgc = curr_cpr.LookaheadGlyphCount; -
4886 -
4887 if ( context_length != 0xFFFF && context_length < igc )
never evaluated: context_length != 0xFFFF
never evaluated: context_length < igc
0
4888 goto next_chainposrule;
never executed: goto next_chainposrule;
0
4889 -
4890 -
4891 -
4892 if ( bgc > buffer->in_pos || buffer->in_pos + igc + lgc > buffer->in_length )
never evaluated: bgc > buffer->in_pos
never evaluated: buffer->in_pos + igc + lgc > buffer->in_length
0
4893 goto next_chainposrule;
never executed: goto next_chainposrule;
0
4894 -
4895 if ( bgc )
never evaluated: bgc
0
4896 { -
4897 -
4898 -
4899 -
4900 for ( i = 0, j = buffer->in_pos - 1; i < bgc; i++, j-- )
never evaluated: i < bgc
0
4901 { -
4902 while ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
4903 { -
4904 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
4905 return error;
never executed: return error;
0
4906 -
4907 if ( j + 1 == bgc - i )
never evaluated: j + 1 == bgc - i
0
4908 goto next_chainposrule;
never executed: goto next_chainposrule;
0
4909 j--; -
4910 }
never executed: }
0
4911 if ( (buffer->in_string[(j)].gindex) != curr_cpr.Backtrack[i] )
never evaluated: (buffer->in_string[(j)].gindex) != curr_cpr.Backtrack[i]
0
4912 goto next_chainposrule;
never executed: goto next_chainposrule;
0
4913 }
never executed: }
0
4914 }
never executed: }
0
4915 -
4916 -
4917 -
4918 for ( i = 1, j = buffer->in_pos + 1; i < igc; i++, j++ )
never evaluated: i < igc
0
4919 { -
4920 while ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
4921 { -
4922 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
4923 return error;
never executed: return error;
0
4924 -
4925 if ( j + igc - i + lgc == (HB_Int)buffer->in_length )
never evaluated: j + igc - i + lgc == (HB_Int)buffer->in_length
0
4926 goto next_chainposrule;
never executed: goto next_chainposrule;
0
4927 j++; -
4928 }
never executed: }
0
4929 -
4930 if ( (buffer->in_string[(j)].gindex) != curr_cpr.Input[i - 1] )
never evaluated: (buffer->in_string[(j)].gindex) != curr_cpr.Input[i - 1]
0
4931 goto next_chainposrule;
never executed: goto next_chainposrule;
0
4932 }
never executed: }
0
4933 -
4934 -
4935 -
4936 -
4937 for ( i = 0; i < lgc; i++, j++ )
never evaluated: i < lgc
0
4938 { -
4939 while ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
4940 { -
4941 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
4942 return error;
never executed: return error;
0
4943 -
4944 if ( j + lgc - i == (HB_Int)buffer->in_length )
never evaluated: j + lgc - i == (HB_Int)buffer->in_length
0
4945 goto next_chainposrule;
never executed: goto next_chainposrule;
0
4946 j++; -
4947 }
never executed: }
0
4948 -
4949 if ( (buffer->in_string[(j)].gindex) != curr_cpr.Lookahead[i] )
never evaluated: (buffer->in_string[(j)].gindex) != curr_cpr.Lookahead[i]
0
4950 goto next_chainposrule;
never executed: goto next_chainposrule;
0
4951 }
never executed: }
0
4952 -
4953 return Do_ContextPos( gpi, igc, 0
4954 curr_cpr.PosCount, 0
4955 curr_cpr.PosLookupRecord, 0
4956 buffer, 0
4957 nesting_level );
never executed: return Do_ContextPos( gpi, igc, curr_cpr.PosCount, curr_cpr.PosLookupRecord, buffer, nesting_level );
0
4958 -
4959 next_chainposrule: -
4960 ; -
4961 }
never executed: }
0
4962 -
4963 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
4964} -
4965 -
4966 -
4967static HB_Error Lookup_ChainContextPos2( -
4968 GPOS_Instance* gpi, -
4969 HB_ChainContextPosFormat2* ccpf2, -
4970 HB_Buffer buffer, -
4971 HB_UShort flags, -
4972 HB_UShort context_length, -
4973 int nesting_level ) -
4974{ -
4975 HB_UShort index, property; -
4976 HB_Error error; -
4977 HB_UShort i, j, k; -
4978 HB_UShort bgc, igc, lgc; -
4979 HB_UShort known_backtrack_classes, -
4980 known_input_classes, -
4981 known_lookahead_classes; -
4982 -
4983 HB_UShort* backtrack_classes; -
4984 HB_UShort* input_classes; -
4985 HB_UShort* lookahead_classes; -
4986 -
4987 HB_UShort* bc; -
4988 HB_UShort* ic; -
4989 HB_UShort* lc; -
4990 HB_GPOSHeader* gpos = gpi->gpos; -
4991 -
4992 HB_ChainPosClassSet* cpcs; -
4993 HB_ChainPosClassRule cpcr; -
4994 HB_GDEFHeader* gdef; -
4995 -
4996 -
4997 gdef = gpos->gdef; -
4998 -
4999 if ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
0
5000 return error;
never executed: return error;
0
5001 -
5002 -
5003 -
5004 -
5005 -
5006 error = _HB_OPEN_Coverage_Index( &ccpf2->Coverage, (buffer->in_string[buffer->in_pos].gindex), &index ); -
5007 if ( error )
never evaluated: error
0
5008 return error;
never executed: return error;
0
5009 -
5010 if ( ( (backtrack_classes) = _hb_alloc( (ccpf2->MaxBacktrackLength)*sizeof(HB_UShort), &error ), error != 0 ) )
never evaluated: ( (backtrack_classes) = _hb_alloc( (ccpf2->MaxBacktrackLength)*sizeof(HB_UShort), &error ), error != 0 )
0
5011 return error;
never executed: return error;
0
5012 known_backtrack_classes = 0; -
5013 -
5014 if (ccpf2->MaxInputLength < 1)
never evaluated: ccpf2->MaxInputLength < 1
0
5015 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
5016 -
5017 if ( ( (input_classes) = _hb_alloc( (ccpf2->MaxInputLength)*sizeof(HB_UShort), &error ), error != 0 ) )
never evaluated: ( (input_classes) = _hb_alloc( (ccpf2->MaxInputLength)*sizeof(HB_UShort), &error ), error != 0 )
0
5018 goto End3;
never executed: goto End3;
0
5019 known_input_classes = 1; -
5020 -
5021 if ( ( (lookahead_classes) = _hb_alloc( (ccpf2->MaxLookaheadLength)*sizeof(HB_UShort), &error ), error != 0 ) )
never evaluated: ( (lookahead_classes) = _hb_alloc( (ccpf2->MaxLookaheadLength)*sizeof(HB_UShort), &error ), error != 0 )
0
5022 goto End2;
never executed: goto End2;
0
5023 known_lookahead_classes = 0; -
5024 -
5025 error = _HB_OPEN_Get_Class( &ccpf2->InputClassDef, (buffer->in_string[buffer->in_pos].gindex), -
5026 &input_classes[0], ((void *)0) ); -
5027 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
5028 goto End1;
never executed: goto End1;
0
5029 -
5030 cpcs = &ccpf2->ChainPosClassSet[input_classes[0]]; -
5031 if ( !cpcs )
never evaluated: !cpcs
0
5032 { -
5033 error = _hb_err (HB_Err_Invalid_SubTable); -
5034 goto End1;
never executed: goto End1;
0
5035 } -
5036 -
5037 for ( k = 0; k < cpcs->ChainPosClassRuleCount; k++ )
never evaluated: k < cpcs->ChainPosClassRuleCount
0
5038 { -
5039 cpcr = cpcs->ChainPosClassRule[k]; -
5040 bgc = cpcr.BacktrackGlyphCount; -
5041 igc = cpcr.InputGlyphCount; -
5042 lgc = cpcr.LookaheadGlyphCount; -
5043 -
5044 if ( context_length != 0xFFFF && context_length < igc )
never evaluated: context_length != 0xFFFF
never evaluated: context_length < igc
0
5045 goto next_chainposclassrule;
never executed: goto next_chainposclassrule;
0
5046 -
5047 -
5048 -
5049 if ( bgc > buffer->in_pos || buffer->in_pos + igc + lgc > buffer->in_length )
never evaluated: bgc > buffer->in_pos
never evaluated: buffer->in_pos + igc + lgc > buffer->in_length
0
5050 goto next_chainposclassrule;
never executed: goto next_chainposclassrule;
0
5051 -
5052 if ( bgc )
never evaluated: bgc
0
5053 { -
5054 -
5055 -
5056 -
5057 -
5058 bc = cpcr.Backtrack; -
5059 -
5060 for ( i = 0, j = buffer->in_pos - 1; i < bgc; i++, j-- )
never evaluated: i < bgc
0
5061 { -
5062 while ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
5063 { -
5064 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
5065 goto End1;
never executed: goto End1;
0
5066 -
5067 if ( j + 1 == bgc - i )
never evaluated: j + 1 == bgc - i
0
5068 goto next_chainposclassrule;
never executed: goto next_chainposclassrule;
0
5069 j++; -
5070 }
never executed: }
0
5071 -
5072 if ( i >= known_backtrack_classes )
never evaluated: i >= known_backtrack_classes
0
5073 { -
5074 -
5075 -
5076 error = _HB_OPEN_Get_Class( &ccpf2->BacktrackClassDef, (buffer->in_string[(j)].gindex), -
5077 &backtrack_classes[i], ((void *)0) ); -
5078 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
5079 goto End1;
never executed: goto End1;
0
5080 known_backtrack_classes = i; -
5081 }
never executed: }
0
5082 -
5083 if ( bc[i] != backtrack_classes[i] )
never evaluated: bc[i] != backtrack_classes[i]
0
5084 goto next_chainposclassrule;
never executed: goto next_chainposclassrule;
0
5085 }
never executed: }
0
5086 }
never executed: }
0
5087 -
5088 ic = cpcr.Input; -
5089 -
5090 -
5091 -
5092 for ( i = 1, j = buffer->in_pos + 1; i < igc; i++, j++ )
never evaluated: i < igc
0
5093 { -
5094 while ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
5095 { -
5096 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
5097 goto End1;
never executed: goto End1;
0
5098 -
5099 if ( j + igc - i + lgc == (HB_Int)buffer->in_length )
never evaluated: j + igc - i + lgc == (HB_Int)buffer->in_length
0
5100 goto next_chainposclassrule;
never executed: goto next_chainposclassrule;
0
5101 j++; -
5102 }
never executed: }
0
5103 -
5104 if ( i >= known_input_classes )
never evaluated: i >= known_input_classes
0
5105 { -
5106 error = _HB_OPEN_Get_Class( &ccpf2->InputClassDef, (buffer->in_string[(j)].gindex), -
5107 &input_classes[i], ((void *)0) ); -
5108 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
5109 goto End1;
never executed: goto End1;
0
5110 known_input_classes = i; -
5111 }
never executed: }
0
5112 -
5113 if ( ic[i - 1] != input_classes[i] )
never evaluated: ic[i - 1] != input_classes[i]
0
5114 goto next_chainposclassrule;
never executed: goto next_chainposclassrule;
0
5115 }
never executed: }
0
5116 -
5117 -
5118 -
5119 -
5120 lc = cpcr.Lookahead; -
5121 -
5122 for ( i = 0; i < lgc; i++, j++ )
never evaluated: i < lgc
0
5123 { -
5124 while ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
5125 { -
5126 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
5127 goto End1;
never executed: goto End1;
0
5128 -
5129 if ( j + lgc - i == (HB_Int)buffer->in_length )
never evaluated: j + lgc - i == (HB_Int)buffer->in_length
0
5130 goto next_chainposclassrule;
never executed: goto next_chainposclassrule;
0
5131 j++; -
5132 }
never executed: }
0
5133 -
5134 if ( i >= known_lookahead_classes )
never evaluated: i >= known_lookahead_classes
0
5135 { -
5136 error = _HB_OPEN_Get_Class( &ccpf2->LookaheadClassDef, (buffer->in_string[(j)].gindex), -
5137 &lookahead_classes[i], ((void *)0) ); -
5138 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
5139 goto End1;
never executed: goto End1;
0
5140 known_lookahead_classes = i; -
5141 }
never executed: }
0
5142 -
5143 if ( lc[i] != lookahead_classes[i] )
never evaluated: lc[i] != lookahead_classes[i]
0
5144 goto next_chainposclassrule;
never executed: goto next_chainposclassrule;
0
5145 }
never executed: }
0
5146 -
5147 error = Do_ContextPos( gpi, igc, -
5148 cpcr.PosCount, -
5149 cpcr.PosLookupRecord, -
5150 buffer, -
5151 nesting_level ); -
5152 goto End1;
never executed: goto End1;
0
5153 -
5154 next_chainposclassrule: -
5155 ; -
5156 }
never executed: }
0
5157 -
5158 error = HB_Err_Not_Covered; -
5159 -
5160End1:
code before this statement never executed: End1:
0
5161 do { if ( (lookahead_classes) ) { _hb_free( lookahead_classes ); lookahead_classes = ((void *)0); } } while (0);
never evaluated: (lookahead_classes)
never evaluated: 0
never executed: }
never executed: }
0
5162 -
5163End2:
code before this statement never executed: End2:
0
5164 do { if ( (input_classes) ) { _hb_free( input_classes ); input_classes = ((void *)0); } } while (0);
never evaluated: (input_classes)
never evaluated: 0
never executed: }
never executed: }
0
5165 -
5166End3:
code before this statement never executed: End3:
0
5167 do { if ( (backtrack_classes) ) { _hb_free( backtrack_classes ); backtrack_classes = ((void *)0); } } while (0);
never evaluated: (backtrack_classes)
never evaluated: 0
never executed: }
never executed: }
0
5168 return error;
never executed: return error;
0
5169} -
5170 -
5171 -
5172static HB_Error Lookup_ChainContextPos3( -
5173 GPOS_Instance* gpi, -
5174 HB_ChainContextPosFormat3* ccpf3, -
5175 HB_Buffer buffer, -
5176 HB_UShort flags, -
5177 HB_UShort context_length, -
5178 int nesting_level ) -
5179{ -
5180 HB_UShort index, i, j, property; -
5181 HB_UShort bgc, igc, lgc; -
5182 HB_Error error; -
5183 HB_GPOSHeader* gpos = gpi->gpos; -
5184 -
5185 HB_Coverage* bc; -
5186 HB_Coverage* ic; -
5187 HB_Coverage* lc; -
5188 HB_GDEFHeader* gdef; -
5189 -
5190 -
5191 gdef = gpos->gdef; -
5192 -
5193 if ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
0
5194 return error;
never executed: return error;
0
5195 -
5196 bgc = ccpf3->BacktrackGlyphCount; -
5197 igc = ccpf3->InputGlyphCount; -
5198 lgc = ccpf3->LookaheadGlyphCount; -
5199 -
5200 if ( context_length != 0xFFFF && context_length < igc )
never evaluated: context_length != 0xFFFF
never evaluated: context_length < igc
0
5201 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
5202 -
5203 -
5204 -
5205 if ( bgc > buffer->in_pos || buffer->in_pos + igc + lgc > buffer->in_length )
never evaluated: bgc > buffer->in_pos
never evaluated: buffer->in_pos + igc + lgc > buffer->in_length
0
5206 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
5207 -
5208 if ( bgc )
never evaluated: bgc
0
5209 { -
5210 -
5211 -
5212 -
5213 bc = ccpf3->BacktrackCoverage; -
5214 -
5215 for ( i = 0, j = buffer->in_pos - 1; i < bgc; i++, j-- )
never evaluated: i < bgc
0
5216 { -
5217 while ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
5218 { -
5219 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
5220 return error;
never executed: return error;
0
5221 -
5222 if ( j + 1 == bgc - i )
never evaluated: j + 1 == bgc - i
0
5223 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
5224 j--; -
5225 }
never executed: }
0
5226 -
5227 error = _HB_OPEN_Coverage_Index( &bc[i], (buffer->in_string[(j)].gindex), &index ); -
5228 if ( error )
never evaluated: error
0
5229 return error;
never executed: return error;
0
5230 }
never executed: }
0
5231 }
never executed: }
0
5232 -
5233 ic = ccpf3->InputCoverage; -
5234 -
5235 for ( i = 0, j = buffer->in_pos; i < igc; i++, j++ )
never evaluated: i < igc
0
5236 { -
5237 -
5238 while ( j > buffer->in_pos && ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok ) )
never evaluated: j > buffer->in_pos
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
5239 { -
5240 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
5241 return error;
never executed: return error;
0
5242 -
5243 if ( j + igc - i + lgc == (HB_Int)buffer->in_length )
never evaluated: j + igc - i + lgc == (HB_Int)buffer->in_length
0
5244 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
5245 j++; -
5246 }
never executed: }
0
5247 -
5248 error = _HB_OPEN_Coverage_Index( &ic[i], (buffer->in_string[(j)].gindex), &index ); -
5249 if ( error )
never evaluated: error
0
5250 return error;
never executed: return error;
0
5251 }
never executed: }
0
5252 -
5253 -
5254 -
5255 -
5256 lc = ccpf3->LookaheadCoverage; -
5257 -
5258 for ( i = 0; i < lgc; i++, j++ )
never evaluated: i < lgc
0
5259 { -
5260 while ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
5261 { -
5262 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
5263 return error;
never executed: return error;
0
5264 -
5265 if ( j + lgc - i == (HB_Int)buffer->in_length )
never evaluated: j + lgc - i == (HB_Int)buffer->in_length
0
5266 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
5267 j++; -
5268 }
never executed: }
0
5269 -
5270 error = _HB_OPEN_Coverage_Index( &lc[i], (buffer->in_string[(j)].gindex), &index ); -
5271 if ( error )
never evaluated: error
0
5272 return error;
never executed: return error;
0
5273 }
never executed: }
0
5274 -
5275 return Do_ContextPos( gpi, igc, 0
5276 ccpf3->PosCount, 0
5277 ccpf3->PosLookupRecord, 0
5278 buffer, 0
5279 nesting_level );
never executed: return Do_ContextPos( gpi, igc, ccpf3->PosCount, ccpf3->PosLookupRecord, buffer, nesting_level );
0
5280} -
5281 -
5282 -
5283static HB_Error Lookup_ChainContextPos( -
5284 GPOS_Instance* gpi, -
5285 HB_GPOS_SubTable* st, -
5286 HB_Buffer buffer, -
5287 HB_UShort flags, -
5288 HB_UShort context_length, -
5289 int nesting_level ) -
5290{ -
5291 HB_ChainContextPos* ccp = &st->chain; -
5292 -
5293 switch ( ccp->PosFormat ) -
5294 { -
5295 case 1: -
5296 return Lookup_ChainContextPos1( gpi, &ccp->ccpf.ccpf1, buffer, 0
5297 flags, context_length, 0
5298 nesting_level );
never executed: return Lookup_ChainContextPos1( gpi, &ccp->ccpf.ccpf1, buffer, flags, context_length, nesting_level );
0
5299 -
5300 case 2: -
5301 return Lookup_ChainContextPos2( gpi, &ccp->ccpf.ccpf2, buffer, 0
5302 flags, context_length, 0
5303 nesting_level );
never executed: return Lookup_ChainContextPos2( gpi, &ccp->ccpf.ccpf2, buffer, flags, context_length, nesting_level );
0
5304 -
5305 case 3: -
5306 return Lookup_ChainContextPos3( gpi, &ccp->ccpf.ccpf3, buffer, 0
5307 flags, context_length, 0
5308 nesting_level );
never executed: return Lookup_ChainContextPos3( gpi, &ccp->ccpf.ccpf3, buffer, flags, context_length, nesting_level );
0
5309 -
5310 default: -
5311 return _hb_err (HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
5312 } -
5313 -
5314 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
5315} -
5316HB_Error HB_GPOS_Select_Script( HB_GPOSHeader* gpos, -
5317 HB_UInt script_tag, -
5318 HB_UShort* script_index ) -
5319{ -
5320 HB_UShort n; -
5321 -
5322 HB_ScriptList* sl; -
5323 HB_ScriptRecord* sr; -
5324 -
5325 -
5326 if ( !gpos || !script_index )
partially evaluated: !gpos
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:460
partially evaluated: !script_index
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:460
0-460
5327 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
5328 -
5329 sl = &gpos->ScriptList; -
5330 sr = sl->ScriptRecord; -
5331 -
5332 for ( n = 0; n < sl->ScriptCount; n++ )
evaluated: n < sl->ScriptCount
TRUEFALSE
yes
Evaluation Count:5588
yes
Evaluation Count:1
1-5588
5333 if ( script_tag == sr[n].ScriptTag )
evaluated: script_tag == sr[n].ScriptTag
TRUEFALSE
yes
Evaluation Count:459
yes
Evaluation Count:5129
459-5129
5334 { -
5335 *script_index = n; -
5336 -
5337 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:459
459
5338 } -
5339 -
5340 return HB_Err_Not_Covered;
executed: return HB_Err_Not_Covered;
Execution Count:1
1
5341} -
5342 -
5343 -
5344 -
5345HB_Error HB_GPOS_Select_Language( HB_GPOSHeader* gpos, -
5346 HB_UInt language_tag, -
5347 HB_UShort script_index, -
5348 HB_UShort* language_index, -
5349 HB_UShort* req_feature_index ) -
5350{ -
5351 HB_UShort n; -
5352 -
5353 HB_ScriptList* sl; -
5354 HB_ScriptRecord* sr; -
5355 HB_ScriptTable* s; -
5356 HB_LangSysRecord* lsr; -
5357 -
5358 -
5359 if ( !gpos || !language_index || !req_feature_index )
never evaluated: !gpos
never evaluated: !language_index
never evaluated: !req_feature_index
0
5360 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
5361 -
5362 sl = &gpos->ScriptList; -
5363 sr = sl->ScriptRecord; -
5364 -
5365 if ( script_index >= sl->ScriptCount )
never evaluated: script_index >= sl->ScriptCount
0
5366 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
5367 -
5368 s = &sr[script_index].Script; -
5369 lsr = s->LangSysRecord; -
5370 -
5371 for ( n = 0; n < s->LangSysCount; n++ )
never evaluated: n < s->LangSysCount
0
5372 if ( language_tag == lsr[n].LangSysTag )
never evaluated: language_tag == lsr[n].LangSysTag
0
5373 { -
5374 *language_index = n; -
5375 *req_feature_index = lsr[n].LangSys.ReqFeatureIndex; -
5376 -
5377 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
5378 } -
5379 -
5380 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
5381} -
5382 -
5383 -
5384 -
5385 -
5386 -
5387 -
5388HB_Error HB_GPOS_Select_Feature( HB_GPOSHeader* gpos, -
5389 HB_UInt feature_tag, -
5390 HB_UShort script_index, -
5391 HB_UShort language_index, -
5392 HB_UShort* feature_index ) -
5393{ -
5394 HB_UShort n; -
5395 -
5396 HB_ScriptList* sl; -
5397 HB_ScriptRecord* sr; -
5398 HB_ScriptTable* s; -
5399 HB_LangSysRecord* lsr; -
5400 HB_LangSys* ls; -
5401 HB_UShort* fi; -
5402 -
5403 HB_FeatureList* fl; -
5404 HB_FeatureRecord* fr; -
5405 -
5406 -
5407 if ( !gpos || !feature_index )
partially evaluated: !gpos
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1259
partially evaluated: !feature_index
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1259
0-1259
5408 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
5409 -
5410 sl = &gpos->ScriptList; -
5411 sr = sl->ScriptRecord; -
5412 -
5413 fl = &gpos->FeatureList; -
5414 fr = fl->FeatureRecord; -
5415 -
5416 if ( script_index >= sl->ScriptCount )
partially evaluated: script_index >= sl->ScriptCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1259
0-1259
5417 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
5418 -
5419 s = &sr[script_index].Script; -
5420 lsr = s->LangSysRecord; -
5421 -
5422 if ( language_index == 0xFFFF )
partially evaluated: language_index == 0xFFFF
TRUEFALSE
yes
Evaluation Count:1259
no
Evaluation Count:0
0-1259
5423 ls = &s->DefaultLangSys;
executed: ls = &s->DefaultLangSys;
Execution Count:1259
1259
5424 else -
5425 { -
5426 if ( language_index >= s->LangSysCount )
never evaluated: language_index >= s->LangSysCount
0
5427 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
5428 -
5429 ls = &lsr[language_index].LangSys; -
5430 }
never executed: }
0
5431 -
5432 fi = ls->FeatureIndex; -
5433 -
5434 for ( n = 0; n < ls->FeatureCount; n++ )
partially evaluated: n < ls->FeatureCount
TRUEFALSE
yes
Evaluation Count:2406
no
Evaluation Count:0
0-2406
5435 { -
5436 if ( fi[n] >= fl->FeatureCount )
partially evaluated: fi[n] >= fl->FeatureCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2406
0-2406
5437 return _hb_err (HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
5438 -
5439 if ( feature_tag == fr[fi[n]].FeatureTag )
evaluated: feature_tag == fr[fi[n]].FeatureTag
TRUEFALSE
yes
Evaluation Count:1259
yes
Evaluation Count:1147
1147-1259
5440 { -
5441 *feature_index = fi[n]; -
5442 -
5443 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:1259
1259
5444 } -
5445 }
executed: }
Execution Count:1147
1147
5446 -
5447 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
5448} -
5449 -
5450 -
5451 -
5452 -
5453 -
5454HB_Error HB_GPOS_Query_Scripts( HB_GPOSHeader* gpos, -
5455 HB_UInt** script_tag_list ) -
5456{ -
5457 HB_Error error; -
5458 HB_UShort n; -
5459 HB_UInt* stl; -
5460 -
5461 HB_ScriptList* sl; -
5462 HB_ScriptRecord* sr; -
5463 -
5464 -
5465 if ( !gpos || !script_tag_list )
never evaluated: !gpos
never evaluated: !script_tag_list
0
5466 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
5467 -
5468 sl = &gpos->ScriptList; -
5469 sr = sl->ScriptRecord; -
5470 -
5471 if ( ( (stl) = _hb_alloc( (sl->ScriptCount + 1)*sizeof(HB_UInt), &error ), error != 0 ) )
never evaluated: ( (stl) = _hb_alloc( (sl->ScriptCount + 1)*sizeof(HB_UInt), &error ), error != 0 )
0
5472 return error;
never executed: return error;
0
5473 -
5474 for ( n = 0; n < sl->ScriptCount; n++ )
never evaluated: n < sl->ScriptCount
0
5475 stl[n] = sr[n].ScriptTag;
never executed: stl[n] = sr[n].ScriptTag;
0
5476 stl[n] = 0; -
5477 -
5478 *script_tag_list = stl; -
5479 -
5480 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
5481} -
5482 -
5483 -
5484 -
5485HB_Error HB_GPOS_Query_Languages( HB_GPOSHeader* gpos, -
5486 HB_UShort script_index, -
5487 HB_UInt** language_tag_list ) -
5488{ -
5489 HB_Error error; -
5490 HB_UShort n; -
5491 HB_UInt* ltl; -
5492 -
5493 HB_ScriptList* sl; -
5494 HB_ScriptRecord* sr; -
5495 HB_ScriptTable* s; -
5496 HB_LangSysRecord* lsr; -
5497 -
5498 -
5499 if ( !gpos || !language_tag_list )
never evaluated: !gpos
never evaluated: !language_tag_list
0
5500 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
5501 -
5502 sl = &gpos->ScriptList; -
5503 sr = sl->ScriptRecord; -
5504 -
5505 if ( script_index >= sl->ScriptCount )
never evaluated: script_index >= sl->ScriptCount
0
5506 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
5507 -
5508 s = &sr[script_index].Script; -
5509 lsr = s->LangSysRecord; -
5510 -
5511 if ( ( (ltl) = _hb_alloc( (s->LangSysCount + 1)*sizeof(HB_UInt), &error ), error != 0 ) )
never evaluated: ( (ltl) = _hb_alloc( (s->LangSysCount + 1)*sizeof(HB_UInt), &error ), error != 0 )
0
5512 return error;
never executed: return error;
0
5513 -
5514 for ( n = 0; n < s->LangSysCount; n++ )
never evaluated: n < s->LangSysCount
0
5515 ltl[n] = lsr[n].LangSysTag;
never executed: ltl[n] = lsr[n].LangSysTag;
0
5516 ltl[n] = 0; -
5517 -
5518 *language_tag_list = ltl; -
5519 -
5520 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
5521} -
5522 -
5523 -
5524 -
5525 -
5526 -
5527 -
5528HB_Error HB_GPOS_Query_Features( HB_GPOSHeader* gpos, -
5529 HB_UShort script_index, -
5530 HB_UShort language_index, -
5531 HB_UInt** feature_tag_list ) -
5532{ -
5533 HB_UShort n; -
5534 HB_Error error; -
5535 HB_UInt* ftl; -
5536 -
5537 HB_ScriptList* sl; -
5538 HB_ScriptRecord* sr; -
5539 HB_ScriptTable* s; -
5540 HB_LangSysRecord* lsr; -
5541 HB_LangSys* ls; -
5542 HB_UShort* fi; -
5543 -
5544 HB_FeatureList* fl; -
5545 HB_FeatureRecord* fr; -
5546 -
5547 -
5548 if ( !gpos || !feature_tag_list )
partially evaluated: !gpos
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:459
partially evaluated: !feature_tag_list
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:459
0-459
5549 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
5550 -
5551 sl = &gpos->ScriptList; -
5552 sr = sl->ScriptRecord; -
5553 -
5554 fl = &gpos->FeatureList; -
5555 fr = fl->FeatureRecord; -
5556 -
5557 if ( script_index >= sl->ScriptCount )
partially evaluated: script_index >= sl->ScriptCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:459
0-459
5558 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
5559 -
5560 s = &sr[script_index].Script; -
5561 lsr = s->LangSysRecord; -
5562 -
5563 if ( language_index == 0xFFFF )
partially evaluated: language_index == 0xFFFF
TRUEFALSE
yes
Evaluation Count:459
no
Evaluation Count:0
0-459
5564 ls = &s->DefaultLangSys;
executed: ls = &s->DefaultLangSys;
Execution Count:459
459
5565 else -
5566 { -
5567 if ( language_index >= s->LangSysCount )
never evaluated: language_index >= s->LangSysCount
0
5568 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
5569 -
5570 ls = &lsr[language_index].LangSys; -
5571 }
never executed: }
0
5572 -
5573 fi = ls->FeatureIndex; -
5574 -
5575 if ( ( (ftl) = _hb_alloc( (ls->FeatureCount + 1)*sizeof(HB_UInt), &error ), error != 0 ) )
partially evaluated: ( (ftl) = _hb_alloc( (ls->FeatureCount + 1)*sizeof(HB_UInt), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:459
0-459
5576 return error;
never executed: return error;
0
5577 -
5578 for ( n = 0; n < ls->FeatureCount; n++ )
evaluated: n < ls->FeatureCount
TRUEFALSE
yes
Evaluation Count:1259
yes
Evaluation Count:459
459-1259
5579 { -
5580 if ( fi[n] >= fl->FeatureCount )
partially evaluated: fi[n] >= fl->FeatureCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1259
0-1259
5581 { -
5582 do { if ( (ftl) ) { _hb_free( ftl ); ftl = ((void *)0); } } while (0);
never executed: }
never executed: }
never evaluated: (ftl)
never evaluated: 0
0
5583 return _hb_err (HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
5584 } -
5585 ftl[n] = fr[fi[n]].FeatureTag; -
5586 }
executed: }
Execution Count:1259
1259
5587 ftl[n] = 0; -
5588 -
5589 *feature_tag_list = ftl; -
5590 -
5591 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:459
459
5592} -
5593 -
5594 -
5595 -
5596 -
5597static HB_Error GPOS_Do_Glyph_Lookup( GPOS_Instance* gpi, -
5598 HB_UShort lookup_index, -
5599 HB_Buffer buffer, -
5600 HB_UShort context_length, -
5601 int nesting_level ) -
5602{ -
5603 HB_Error error = HB_Err_Not_Covered; -
5604 HB_UShort i, flags, lookup_count; -
5605 HB_GPOSHeader* gpos = gpi->gpos; -
5606 HB_Lookup* lo; -
5607 int lookup_type; -
5608 -
5609 -
5610 nesting_level++; -
5611 -
5612 if ( nesting_level > 100 )
partially evaluated: nesting_level > 100
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16119752
0-16119752
5613 return _hb_err (HB_Err_Not_Covered);
never executed: return _hb_err (HB_Err_Not_Covered);
0
5614 -
5615 lookup_count = gpos->LookupList.LookupCount; -
5616 if (lookup_index >= lookup_count)
partially evaluated: lookup_index >= lookup_count
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16119752
0-16119752
5617 return error;
never executed: return error;
0
5618 -
5619 lo = &gpos->LookupList.Lookup[lookup_index]; -
5620 flags = lo->LookupFlag; -
5621 lookup_type = lo->LookupType; -
5622 -
5623 for ( i = 0; i < lo->SubTableCount; i++ )
evaluated: i < lo->SubTableCount
TRUEFALSE
yes
Evaluation Count:31873883
yes
Evaluation Count:15685084
15685084-31873883
5624 { -
5625 HB_GPOS_SubTable *st = &lo->SubTable[i].st.gpos; -
5626 -
5627 switch (lookup_type) { -
5628 case 1: -
5629 error = Lookup_SinglePos ( gpi, st, buffer, flags, context_length, nesting_level ); break;
executed: break;
Execution Count:11
11
5630 case 2: -
5631 error = Lookup_PairPos ( gpi, st, buffer, flags, context_length, nesting_level ); break;
executed: break;
Execution Count:6220365
6220365
5632 case 3: -
5633 error = Lookup_CursivePos ( gpi, st, buffer, flags, context_length, nesting_level ); break;
never executed: break;
0
5634 case 4: -
5635 error = Lookup_MarkBasePos ( gpi, st, buffer, flags, context_length, nesting_level ); break;
executed: break;
Execution Count:16167399
16167399
5636 case 5: -
5637 error = Lookup_MarkLigPos ( gpi, st, buffer, flags, context_length, nesting_level ); break;
executed: break;
Execution Count:2853864
2853864
5638 case 6: -
5639 error = Lookup_MarkMarkPos ( gpi, st, buffer, flags, context_length, nesting_level ); break;
executed: break;
Execution Count:6632244
6632244
5640 case 7: -
5641 error = Lookup_ContextPos ( gpi, st, buffer, flags, context_length, nesting_level ); break;
never executed: break;
0
5642 case 8: -
5643 error = Lookup_ChainContextPos ( gpi, st, buffer, flags, context_length, nesting_level ); break;
never executed: break;
0
5644 -
5645 -
5646 default: -
5647 error = HB_Err_Not_Covered; -
5648 }
never executed: }
0
5649 -
5650 -
5651 -
5652 if ( error != HB_Err_Not_Covered )
evaluated: error != HB_Err_Not_Covered
TRUEFALSE
yes
Evaluation Count:434668
yes
Evaluation Count:31439215
434668-31439215
5653 return error;
executed: return error;
Execution Count:434668
434668
5654 }
executed: }
Execution Count:31439215
31439215
5655 -
5656 return HB_Err_Not_Covered;
executed: return HB_Err_Not_Covered;
Execution Count:15685084
15685084
5657} -
5658 -
5659 -
5660 HB_Error -
5661_HB_GPOS_Load_SubTable( HB_GPOS_SubTable* st, -
5662 HB_Stream stream, -
5663 HB_UShort lookup_type ) -
5664{ -
5665 switch ( lookup_type ) { -
5666 case 1: return Load_SinglePos ( st, stream );
executed: return Load_SinglePos ( st, stream );
Execution Count:14
14
5667 case 2: return Load_PairPos ( st, stream );
executed: return Load_PairPos ( st, stream );
Execution Count:276
276
5668 case 3: return Load_CursivePos ( st, stream );
never executed: return Load_CursivePos ( st, stream );
0
5669 case 4: return Load_MarkBasePos ( st, stream );
executed: return Load_MarkBasePos ( st, stream );
Execution Count:1298
1298
5670 case 5: return Load_MarkLigPos ( st, stream );
executed: return Load_MarkLigPos ( st, stream );
Execution Count:343
343
5671 case 6: return Load_MarkMarkPos ( st, stream );
executed: return Load_MarkMarkPos ( st, stream );
Execution Count:753
753
5672 case 7: return Load_ContextPos ( st, stream );
never executed: return Load_ContextPos ( st, stream );
0
5673 case 8: return Load_ChainContextPos ( st, stream );
never executed: return Load_ChainContextPos ( st, stream );
0
5674 -
5675 default: return _hb_err (HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
5676 } -
5677}
never executed: }
0
5678 -
5679 -
5680 void -
5681_HB_GPOS_Free_SubTable( HB_GPOS_SubTable* st, -
5682 HB_UShort lookup_type ) -
5683{ -
5684 switch ( lookup_type ) { -
5685 case 1: Free_SinglePos ( st ); return;
executed: return;
Execution Count:12
12
5686 case 2: Free_PairPos ( st ); return;
executed: return;
Execution Count:264
264
5687 case 3: Free_CursivePos ( st ); return;
never executed: return;
0
5688 case 4: Free_MarkBasePos ( st ); return;
executed: return;
Execution Count:1233
1233
5689 case 5: Free_MarkLigPos ( st ); return;
executed: return;
Execution Count:323
323
5690 case 6: Free_MarkMarkPos ( st ); return;
executed: return;
Execution Count:715
715
5691 case 7: Free_ContextPos ( st ); return;
never executed: return;
0
5692 case 8: Free_ChainContextPos ( st ); return;
never executed: return;
0
5693 -
5694 default: return;
never executed: return;
0
5695 } -
5696}
never executed: }
0
5697 -
5698 -
5699 -
5700 -
5701static HB_Error GPOS_Do_String_Lookup( GPOS_Instance* gpi, -
5702 HB_UShort lookup_index, -
5703 HB_Buffer buffer ) -
5704{ -
5705 HB_Error error, retError = HB_Err_Not_Covered; -
5706 HB_GPOSHeader* gpos = gpi->gpos; -
5707 -
5708 HB_UInt* properties = gpos->LookupList.Properties; -
5709 -
5710 const int nesting_level = 0; -
5711 -
5712 const HB_UShort context_length = 0xFFFF; -
5713 -
5714 -
5715 gpi->last = 0xFFFF; -
5716 -
5717 buffer->in_pos = 0; -
5718 while ( buffer->in_pos < buffer->in_length )
evaluated: buffer->in_pos < buffer->in_length
TRUEFALSE
yes
Evaluation Count:16119752
yes
Evaluation Count:1214652
1214652-16119752
5719 { -
5720 if ( ~(buffer->in_string[(buffer->in_pos)].properties) & properties[lookup_index] )
partially evaluated: ~(buffer->in_string[(buffer->in_pos)].properties) & properties[lookup_index]
TRUEFALSE
yes
Evaluation Count:16119752
no
Evaluation Count:0
0-16119752
5721 { -
5722 -
5723 -
5724 -
5725 -
5726 -
5727 -
5728 -
5729 error = GPOS_Do_Glyph_Lookup( gpi, lookup_index, buffer, context_length, nesting_level ); -
5730 if ( error && error != HB_Err_Not_Covered )
evaluated: error
TRUEFALSE
yes
Evaluation Count:15685084
yes
Evaluation Count:434668
partially evaluated: error != HB_Err_Not_Covered
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15685084
0-15685084
5731 return error;
never executed: return error;
0
5732 }
executed: }
Execution Count:16119752
16119752
5733 else -
5734 { -
5735 -
5736 -
5737 gpi->last = 0xFFFF; -
5738 -
5739 error = HB_Err_Not_Covered; -
5740 }
never executed: }
0
5741 -
5742 if ( error == HB_Err_Not_Covered )
evaluated: error == HB_Err_Not_Covered
TRUEFALSE
yes
Evaluation Count:15685084
yes
Evaluation Count:434668
434668-15685084
5743 (buffer->in_pos)++;
executed: (buffer->in_pos)++;
Execution Count:15685084
15685084
5744 else -
5745 retError = error;
executed: retError = error;
Execution Count:434668
434668
5746 } -
5747 -
5748 return retError;
executed: return retError;
Execution Count:1214652
1214652
5749} -
5750 -
5751 -
5752static HB_Error Position_CursiveChain ( HB_Buffer buffer ) -
5753{ -
5754 HB_UInt i, j; -
5755 HB_Position positions = buffer->positions; -
5756 -
5757 -
5758 for (j = 0; j < buffer->in_length; j++)
evaluated: j < buffer->in_length
TRUEFALSE
yes
Evaluation Count:3316560
yes
Evaluation Count:248112
248112-3316560
5759 { -
5760 if (positions[j].cursive_chain > 0)
partially evaluated: positions[j].cursive_chain > 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3316560
0-3316560
5761 positions[j].y_pos += positions[j - positions[j].cursive_chain].y_pos;
never executed: positions[j].y_pos += positions[j - positions[j].cursive_chain].y_pos;
0
5762 }
executed: }
Execution Count:3316560
3316560
5763 -
5764 -
5765 for (i = buffer->in_length; i > 0; i--)
evaluated: i > 0
TRUEFALSE
yes
Evaluation Count:3316560
yes
Evaluation Count:248112
248112-3316560
5766 { -
5767 j = i - 1; -
5768 -
5769 if (positions[j].cursive_chain < 0)
partially evaluated: positions[j].cursive_chain < 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3316560
0-3316560
5770 positions[j].y_pos += positions[j - positions[j].cursive_chain].y_pos;
never executed: positions[j].y_pos += positions[j - positions[j].cursive_chain].y_pos;
0
5771 }
executed: }
Execution Count:3316560
3316560
5772 -
5773 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:248112
248112
5774} -
5775 -
5776 -
5777HB_Error HB_GPOS_Add_Feature( HB_GPOSHeader* gpos, -
5778 HB_UShort feature_index, -
5779 HB_UInt property ) -
5780{ -
5781 HB_UShort i; -
5782 -
5783 HB_Feature feature; -
5784 HB_UInt* properties; -
5785 HB_UShort* index; -
5786 HB_UShort lookup_count; -
5787 -
5788 -
5789 -
5790 if ( !gpos ||
partially evaluated: !gpos
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1259
0-1259
5791 feature_index >= gpos->FeatureList.FeatureCount ||
partially evaluated: feature_index >= gpos->FeatureList.FeatureCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1259
0-1259
5792 gpos->FeatureList.ApplyCount == gpos->FeatureList.FeatureCount )
partially evaluated: gpos->FeatureList.ApplyCount == gpos->FeatureList.FeatureCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1259
0-1259
5793 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
5794 -
5795 gpos->FeatureList.ApplyOrder[gpos->FeatureList.ApplyCount++] = feature_index; -
5796 -
5797 properties = gpos->LookupList.Properties; -
5798 -
5799 feature = gpos->FeatureList.FeatureRecord[feature_index].Feature; -
5800 index = feature.LookupListIndex; -
5801 lookup_count = gpos->LookupList.LookupCount; -
5802 -
5803 for ( i = 0; i < feature.LookupListCount; i++ )
evaluated: i < feature.LookupListCount
TRUEFALSE
yes
Evaluation Count:2284
yes
Evaluation Count:1259
1259-2284
5804 { -
5805 HB_UShort lookup_index = index[i]; -
5806 if (lookup_index < lookup_count)
partially evaluated: lookup_index < lookup_count
TRUEFALSE
yes
Evaluation Count:2284
no
Evaluation Count:0
0-2284
5807 properties[lookup_index] |= property;
executed: properties[lookup_index] |= property;
Execution Count:2284
2284
5808 }
executed: }
Execution Count:2284
2284
5809 -
5810 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:1259
1259
5811} -
5812 -
5813 -
5814 -
5815HB_Error HB_GPOS_Clear_Features( HB_GPOSHeader* gpos ) -
5816{ -
5817 HB_UShort i; -
5818 -
5819 HB_UInt* properties; -
5820 -
5821 -
5822 if ( !gpos )
partially evaluated: !gpos
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:460
0-460
5823 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
5824 -
5825 gpos->FeatureList.ApplyCount = 0; -
5826 -
5827 properties = gpos->LookupList.Properties; -
5828 -
5829 for ( i = 0; i < gpos->LookupList.LookupCount; i++ )
evaluated: i < gpos->LookupList.LookupCount
TRUEFALSE
yes
Evaluation Count:7176
yes
Evaluation Count:460
460-7176
5830 properties[i] = 0;
executed: properties[i] = 0;
Execution Count:7176
7176
5831 -
5832 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:460
460
5833} -
5834HB_Error HB_GPOS_Apply_String( HB_Font font, -
5835 HB_GPOSHeader* gpos, -
5836 HB_UShort load_flags, -
5837 HB_Buffer buffer, -
5838 HB_Bool dvi, -
5839 HB_Bool r2l ) -
5840{ -
5841 HB_Error error, retError = HB_Err_Not_Covered; -
5842 GPOS_Instance gpi; -
5843 int i, j, lookup_count, num_features; -
5844 -
5845 if ( !font || !gpos || !buffer )
partially evaluated: !font
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:248113
partially evaluated: !gpos
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:248113
partially evaluated: !buffer
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:248113
0-248113
5846 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
5847 -
5848 if ( buffer->in_length == 0 )
partially evaluated: buffer->in_length == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:248113
0-248113
5849 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
5850 -
5851 gpi.font = font; -
5852 gpi.gpos = gpos; -
5853 gpi.load_flags = load_flags; -
5854 gpi.r2l = r2l; -
5855 gpi.dvi = dvi; -
5856 -
5857 lookup_count = gpos->LookupList.LookupCount; -
5858 num_features = gpos->FeatureList.ApplyCount; -
5859 -
5860 if ( num_features )
evaluated: num_features
TRUEFALSE
yes
Evaluation Count:248112
yes
Evaluation Count:1
1-248112
5861 { -
5862 error = _hb_buffer_clear_positions( buffer ); -
5863 if ( error )
partially evaluated: error
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:248112
0-248112
5864 return error;
never executed: return error;
0
5865 }
executed: }
Execution Count:248112
248112
5866 -
5867 for ( i = 0; i < num_features; i++ )
evaluated: i < num_features
TRUEFALSE
yes
Evaluation Count:744153
yes
Evaluation Count:248113
248113-744153
5868 { -
5869 HB_UShort feature_index = gpos->FeatureList.ApplyOrder[i]; -
5870 HB_Feature feature = gpos->FeatureList.FeatureRecord[feature_index].Feature; -
5871 -
5872 for ( j = 0; j < feature.LookupListCount; j++ )
evaluated: j < feature.LookupListCount
TRUEFALSE
yes
Evaluation Count:1214652
yes
Evaluation Count:744153
744153-1214652
5873 { -
5874 HB_UShort lookup_index = feature.LookupListIndex[j]; -
5875 -
5876 -
5877 if (lookup_index >= lookup_count)
partially evaluated: lookup_index >= lookup_count
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1214652
0-1214652
5878 continue;
never executed: continue;
0
5879 -
5880 error = GPOS_Do_String_Lookup( &gpi, lookup_index, buffer ); -
5881 if ( error )
evaluated: error
TRUEFALSE
yes
Evaluation Count:1129190
yes
Evaluation Count:85462
85462-1129190
5882 { -
5883 if ( error != HB_Err_Not_Covered )
partially evaluated: error != HB_Err_Not_Covered
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1129190
0-1129190
5884 return error;
never executed: return error;
0
5885 }
executed: }
Execution Count:1129190
1129190
5886 else -
5887 retError = error;
executed: retError = error;
Execution Count:85462
85462
5888 } -
5889 }
executed: }
Execution Count:744153
744153
5890 -
5891 if ( num_features )
evaluated: num_features
TRUEFALSE
yes
Evaluation Count:248112
yes
Evaluation Count:1
1-248112
5892 { -
5893 error = Position_CursiveChain ( buffer ); -
5894 if ( error )
partially evaluated: error
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:248112
0-248112
5895 return error;
never executed: return error;
0
5896 }
executed: }
Execution Count:248112
248112
5897 -
5898 return retError;
executed: return retError;
Execution Count:248113
248113
5899} -
5900 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial