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

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2static HB_Error GSUB_Do_Glyph_Lookup( HB_GSUBHeader* gsub, -
3 HB_UShort lookup_index, -
4 HB_Buffer buffer, -
5 HB_UShort context_length, -
6 int nesting_level ); -
7HB_Error HB_Load_GSUB_Table( HB_Stream stream, -
8 HB_GSUBHeader** retptr, -
9 HB_GDEFHeader* gdef, -
10 HB_Stream gdefStream ) -
11{ -
12 HB_Error error = HB_Err_Ok; -
13 HB_UInt cur_offset, new_offset, base_offset; -
14 -
15 HB_GSUBHeader* gsub; -
16 -
17 if ( !retptr )
partially evaluated: !retptr
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
18 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
19 -
20 if ( (0) )
partially evaluated: (0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
21 return error;
never executed: return error;
0
22 -
23 base_offset = _hb_stream_pos( stream ); -
24 -
25 if ( ( (gsub) = _hb_alloc( sizeof( *gsub ), &error ), error != 0 ) )
partially evaluated: ( (gsub) = _hb_alloc( sizeof( *gsub ), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
26 return error;
never executed: return error;
0
27 -
28 -
29 -
30 -
31 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
32 ( (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
33 goto Fail4;
never executed: goto Fail4;
0
34 -
35 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
36 -
37 _hb_stream_frame_exit( stream ); -
38 -
39 cur_offset = _hb_stream_pos( stream ); -
40 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
41 ( error = _HB_OPEN_Load_ScriptList( &gsub->ScriptList, 0-139
42 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_ScriptList( &gsub->ScriptList, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
43 goto Fail4;
never executed: goto Fail4;
0
44 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
45 -
46 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
47 goto Fail3;
never executed: goto Fail3;
0
48 -
49 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
50 -
51 _hb_stream_frame_exit( stream ); -
52 -
53 cur_offset = _hb_stream_pos( stream ); -
54 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
55 ( error = _HB_OPEN_Load_FeatureList( &gsub->FeatureList, 0-139
56 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_FeatureList( &gsub->FeatureList, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
57 goto Fail3;
never executed: goto Fail3;
0
58 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
59 -
60 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
61 goto Fail2;
never executed: goto Fail2;
0
62 -
63 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
64 -
65 _hb_stream_frame_exit( stream ); -
66 -
67 cur_offset = _hb_stream_pos( stream ); -
68 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
69 ( error = _HB_OPEN_Load_LookupList( &gsub->LookupList, 0-139
70 stream, HB_Type_GSUB ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_LookupList( &gsub->LookupList, stream, HB_Type_GSUB ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
71 goto Fail2;
never executed: goto Fail2;
0
72 -
73 gsub->gdef = gdef; -
74 -
75 if ( ( error = _HB_GDEF_LoadMarkAttachClassDef_From_LookupFlags( gdef, gdefStream, 0-139
76 gsub->LookupList.Lookup, 0-139
77 gsub->LookupList.LookupCount ) ) )
partially evaluated: ( error = _HB_GDEF_LoadMarkAttachClassDef_From_LookupFlags( gdef, gdefStream, gsub->LookupList.Lookup, gsub->LookupList.LookupCount ) )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
78 goto Fail1;
never executed: goto Fail1;
0
79 -
80 *retptr = gsub; -
81 -
82 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:139
139
83 -
84Fail1: -
85 _HB_OPEN_Free_LookupList( &gsub->LookupList, HB_Type_GSUB ); -
86 -
87Fail2:
code before this statement never executed: Fail2:
0
88 _HB_OPEN_Free_FeatureList( &gsub->FeatureList ); -
89 -
90Fail3:
code before this statement never executed: Fail3:
0
91 _HB_OPEN_Free_ScriptList( &gsub->ScriptList ); -
92 -
93Fail4:
code before this statement never executed: Fail4:
0
94 do { if ( (gsub) ) { _hb_free( gsub ); gsub = ((void *)0); } } while (0);
never executed: }
never executed: }
never evaluated: 0
never evaluated: (gsub)
0
95 -
96 -
97 return error;
never executed: return error;
0
98} -
99 -
100 -
101HB_Error HB_Done_GSUB_Table( HB_GSUBHeader* gsub ) -
102{ -
103 _HB_OPEN_Free_LookupList( &gsub->LookupList, HB_Type_GSUB ); -
104 _HB_OPEN_Free_FeatureList( &gsub->FeatureList ); -
105 _HB_OPEN_Free_ScriptList( &gsub->ScriptList ); -
106 -
107 do { if ( (gsub) ) { _hb_free( gsub ); gsub = ((void *)0); } } while (0);
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:132
executed: }
Execution Count:132
executed: }
Execution Count:132
partially evaluated: (gsub)
TRUEFALSE
yes
Evaluation Count:132
no
Evaluation Count:0
0-132
108 -
109 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:132
132
110} -
111static HB_Error Load_SingleSubst( HB_GSUB_SubTable* st, -
112 HB_Stream stream ) -
113{ -
114 HB_Error error; -
115 HB_SingleSubst* ss = &st->single; -
116 -
117 HB_UShort n, count; -
118 HB_UInt cur_offset, new_offset, base_offset; -
119 -
120 HB_UShort* s; -
121 -
122 -
123 base_offset = _hb_stream_pos( stream ); -
124 -
125 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:2925
0-2925
126 return error;
never executed: return error;
0
127 -
128 ss->SubstFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
129 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
130 -
131 _hb_stream_frame_exit( stream ); -
132 -
133 cur_offset = _hb_stream_pos( stream ); -
134 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:2925
0-2925
135 ( error = _HB_OPEN_Load_Coverage( &ss->Coverage, stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_Coverage( &ss->Coverage, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2925
0-2925
136 return error;
never executed: return error;
0
137 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
138 -
139 switch ( ss->SubstFormat ) -
140 { -
141 case 1: -
142 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:1258
0-1258
143 goto Fail2;
never executed: goto Fail2;
0
144 -
145 ss->ssf.ssf1.DeltaGlyphID = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
146 -
147 _hb_stream_frame_exit( stream ); -
148 -
149 break;
executed: break;
Execution Count:1258
1258
150 -
151 case 2: -
152 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:1667
0-1667
153 goto Fail2;
never executed: goto Fail2;
0
154 -
155 count = ss->ssf.ssf2.GlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
156 -
157 _hb_stream_frame_exit( stream ); -
158 -
159 ss->ssf.ssf2.Substitute = ((void *)0); -
160 -
161 if ( ( (ss->ssf.ssf2.Substitute) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
partially evaluated: ( (ss->ssf.ssf2.Substitute) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1667
0-1667
162 goto Fail2;
never executed: goto Fail2;
0
163 -
164 s = ss->ssf.ssf2.Substitute; -
165 -
166 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1667
0-1667
167 goto Fail1;
never executed: goto Fail1;
0
168 -
169 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:53854
yes
Evaluation Count:1667
1667-53854
170 s[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
executed: s[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
Execution Count:53854
53854
171 -
172 _hb_stream_frame_exit( stream ); -
173 -
174 break;
executed: break;
Execution Count:1667
1667
175 -
176 default: -
177 return _hb_err (HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
178 } -
179 -
180 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:2925
2925
181 -
182Fail1: -
183 do { if ( (s) ) { _hb_free( s ); s = ((void *)0); } } while (0);
never evaluated: 0
never executed: }
never executed: }
never evaluated: (s)
0
184 -
185Fail2:
code before this statement never executed: Fail2:
0
186 _HB_OPEN_Free_Coverage( &ss->Coverage ); -
187 return error;
never executed: return error;
0
188} -
189 -
190 -
191static void Free_SingleSubst( HB_GSUB_SubTable* st ) -
192{ -
193 HB_SingleSubst* ss = &st->single; -
194 -
195 switch ( ss->SubstFormat ) -
196 { -
197 case 1: -
198 break;
executed: break;
Execution Count:1196
1196
199 -
200 case 2: -
201 do { if ( (ss->ssf.ssf2.Substitute) ) { _hb_free( ss->ssf.ssf2.Substitute ); ss->ssf.ssf2.Substitute = ((void *)0); } } while (0);
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1584
executed: }
Execution Count:1584
executed: }
Execution Count:1584
partially evaluated: (ss->ssf.ssf2.Substitute)
TRUEFALSE
yes
Evaluation Count:1584
no
Evaluation Count:0
0-1584
202 break;
executed: break;
Execution Count:1584
1584
203 -
204 default: -
205 break;
never executed: break;
0
206 } -
207 -
208 _HB_OPEN_Free_Coverage( &ss->Coverage ); -
209}
executed: }
Execution Count:2780
2780
210 -
211 -
212static HB_Error Lookup_SingleSubst( HB_GSUBHeader* gsub, -
213 HB_GSUB_SubTable* st, -
214 HB_Buffer buffer, -
215 HB_UShort flags, -
216 HB_UShort context_length, -
217 int nesting_level ) -
218{ -
219 HB_UShort index, value, property; -
220 HB_Error error; -
221 HB_SingleSubst* ss = &st->single; -
222 HB_GDEFHeader* gdef = gsub->gdef; -
223 -
224 ((nesting_level) = (nesting_level)); -
225 -
226 if ( context_length != 0xFFFF && context_length < 1 )
partially evaluated: context_length != 0xFFFF
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:130
never evaluated: context_length < 1
0-130
227 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
228 -
229 if ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok ) )
partially evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:130
0-130
230 return error;
never executed: return error;
0
231 -
232 error = _HB_OPEN_Coverage_Index( &ss->Coverage, (buffer->in_string[buffer->in_pos].gindex), &index ); -
233 if ( error )
partially evaluated: error
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:130
0-130
234 return error;
never executed: return error;
0
235 -
236 switch ( ss->SubstFormat ) -
237 { -
238 case 1: -
239 value = ( (buffer->in_string[buffer->in_pos].gindex) + ss->ssf.ssf1.DeltaGlyphID ) & 0xFFFF; -
240 if ( ( ( error = _hb_buffer_replace_output_glyph( (buffer), (value), (nesting_level) == 1 ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _hb_buffer_replace_output_glyph( (buffer), (value), (nesting_level) == 1 ) ) != HB_Err_Ok )
0
241 return error;
never executed: return error;
0
242 break;
never executed: break;
0
243 -
244 case 2: -
245 if ( index >= ss->ssf.ssf2.GlyphCount )
partially evaluated: index >= ss->ssf.ssf2.GlyphCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:130
0-130
246 return _hb_err (HB_Err_Invalid_SubTable);
never executed: return _hb_err (HB_Err_Invalid_SubTable);
0
247 value = ss->ssf.ssf2.Substitute[index]; -
248 if ( ( ( error = _hb_buffer_replace_output_glyph( (buffer), (value), (nesting_level) == 1 ) ) != HB_Err_Ok ) )
partially evaluated: ( ( error = _hb_buffer_replace_output_glyph( (buffer), (value), (nesting_level) == 1 ) ) != HB_Err_Ok )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:130
0-130
249 return error;
never executed: return error;
0
250 break;
executed: break;
Execution Count:130
130
251 -
252 default: -
253 return _hb_err (HB_Err_Invalid_SubTable);
never executed: return _hb_err (HB_Err_Invalid_SubTable);
0
254 } -
255 -
256 if ( gdef && gdef->NewGlyphClasses )
partially evaluated: gdef
TRUEFALSE
yes
Evaluation Count:130
no
Evaluation Count:0
partially evaluated: gdef->NewGlyphClasses
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:130
0-130
257 { -
258 -
259 -
260 error = _HB_GDEF_Add_Glyph_Property( gdef, value, property ); -
261 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
262 return error;
never executed: return error;
0
263 }
never executed: }
0
264 -
265 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:130
130
266} -
267 -
268 -
269 -
270 -
271 -
272 -
273static HB_Error Load_Sequence( HB_Sequence* s, -
274 HB_Stream stream ) -
275{ -
276 HB_Error error; -
277 -
278 HB_UShort n, count; -
279 HB_UShort* sub; -
280 -
281 -
282 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:135
0-135
283 return error;
never executed: return error;
0
284 -
285 count = s->GlyphCount = ((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 s->Substitute = ((void *)0); -
290 -
291 if ( count )
partially evaluated: count
TRUEFALSE
yes
Evaluation Count:135
no
Evaluation Count:0
0-135
292 { -
293 if ( ( (s->Substitute) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
partially evaluated: ( (s->Substitute) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:135
0-135
294 return error;
never executed: return error;
0
295 -
296 sub = s->Substitute; -
297 -
298 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:135
0-135
299 { -
300 do { if ( (sub) ) { _hb_free( sub ); sub = ((void *)0); } } while (0);
never evaluated: 0
never executed: }
never executed: }
never evaluated: (sub)
0
301 return error;
never executed: return error;
0
302 } -
303 -
304 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:270
yes
Evaluation Count:135
135-270
305 sub[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
executed: sub[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
Execution Count:270
270
306 -
307 _hb_stream_frame_exit( stream ); -
308 }
executed: }
Execution Count:135
135
309 -
310 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:135
135
311} -
312 -
313 -
314static void Free_Sequence( HB_Sequence* s ) -
315{ -
316 do { if ( (s->Substitute) ) { _hb_free( s->Substitute ); s->Substitute = ((void *)0); } } while (0);
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:135
executed: }
Execution Count:135
executed: }
Execution Count:135
partially evaluated: (s->Substitute)
TRUEFALSE
yes
Evaluation Count:135
no
Evaluation Count:0
0-135
317}
executed: }
Execution Count:135
135
318 -
319 -
320 -
321 -
322static HB_Error Load_MultipleSubst( HB_GSUB_SubTable* st, -
323 HB_Stream stream ) -
324{ -
325 HB_Error error; -
326 HB_MultipleSubst* ms = &st->multiple; -
327 -
328 HB_UShort n = 0, m, count; -
329 HB_UInt cur_offset, new_offset, base_offset; -
330 -
331 HB_Sequence* s; -
332 -
333 -
334 base_offset = _hb_stream_pos( stream ); -
335 -
336 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:8
0-8
337 return error;
never executed: return error;
0
338 -
339 ms->SubstFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
340 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
341 -
342 _hb_stream_frame_exit( stream ); -
343 -
344 cur_offset = _hb_stream_pos( stream ); -
345 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:8
0-8
346 ( error = _HB_OPEN_Load_Coverage( &ms->Coverage, stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_Coverage( &ms->Coverage, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
347 return error;
never executed: return error;
0
348 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
349 -
350 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:8
0-8
351 goto Fail2;
never executed: goto Fail2;
0
352 -
353 count = ms->SequenceCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
354 -
355 _hb_stream_frame_exit( stream ); -
356 -
357 ms->Sequence = ((void *)0); -
358 -
359 if ( ( (ms->Sequence) = _hb_alloc( (count)*sizeof(HB_Sequence), &error ), error != 0 ) )
partially evaluated: ( (ms->Sequence) = _hb_alloc( (count)*sizeof(HB_Sequence), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
360 goto Fail2;
never executed: goto Fail2;
0
361 -
362 s = ms->Sequence; -
363 -
364 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:135
yes
Evaluation Count:8
8-135
365 { -
366 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:135
0-135
367 goto Fail1;
never executed: goto Fail1;
0
368 -
369 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
370 -
371 _hb_stream_frame_exit( stream ); -
372 -
373 cur_offset = _hb_stream_pos( stream ); -
374 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:135
0-135
375 ( error = Load_Sequence( &s[n], stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_Sequence( &s[n], stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:135
0-135
376 goto Fail1;
never executed: goto Fail1;
0
377 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
378 }
executed: }
Execution Count:135
135
379 -
380 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:8
8
381 -
382Fail1: -
383 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
384 Free_Sequence( &s[m] );
never executed: Free_Sequence( &s[m] );
0
385 -
386 do { if ( (s) ) { _hb_free( s ); s = ((void *)0); } } while (0);
never evaluated: 0
never executed: }
never executed: }
never evaluated: (s)
0
387 -
388Fail2:
code before this statement never executed: Fail2:
0
389 _HB_OPEN_Free_Coverage( &ms->Coverage ); -
390 return error;
never executed: return error;
0
391} -
392 -
393 -
394static void Free_MultipleSubst( HB_GSUB_SubTable* st ) -
395{ -
396 HB_UShort n, count; -
397 HB_MultipleSubst* ms = &st->multiple; -
398 -
399 HB_Sequence* s; -
400 -
401 -
402 if ( ms->Sequence )
partially evaluated: ms->Sequence
TRUEFALSE
yes
Evaluation Count:8
no
Evaluation Count:0
0-8
403 { -
404 count = ms->SequenceCount; -
405 s = ms->Sequence; -
406 -
407 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:135
yes
Evaluation Count:8
8-135
408 Free_Sequence( &s[n] );
executed: Free_Sequence( &s[n] );
Execution Count:135
135
409 -
410 do { if ( (s) ) { _hb_free( s ); s = ((void *)0); } } while (0);
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
executed: }
Execution Count:8
executed: }
Execution Count:8
partially evaluated: (s)
TRUEFALSE
yes
Evaluation Count:8
no
Evaluation Count:0
0-8
411 }
executed: }
Execution Count:8
8
412 -
413 _HB_OPEN_Free_Coverage( &ms->Coverage ); -
414}
executed: }
Execution Count:8
8
415 -
416 -
417static HB_Error Lookup_MultipleSubst( HB_GSUBHeader* gsub, -
418 HB_GSUB_SubTable* st, -
419 HB_Buffer buffer, -
420 HB_UShort flags, -
421 HB_UShort context_length, -
422 int nesting_level ) -
423{ -
424 HB_Error error; -
425 HB_UShort index, property, n, count; -
426 HB_UShort*s; -
427 HB_MultipleSubst* ms = &st->multiple; -
428 HB_GDEFHeader* gdef = gsub->gdef; -
429 -
430 ((nesting_level) = (nesting_level)); -
431 -
432 if ( context_length != 0xFFFF && context_length < 1 )
partially evaluated: context_length != 0xFFFF
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:411685
never evaluated: context_length < 1
0-411685
433 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
434 -
435 if ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok ) )
partially evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:411685
0-411685
436 return error;
never executed: return error;
0
437 -
438 error = _HB_OPEN_Coverage_Index( &ms->Coverage, (buffer->in_string[buffer->in_pos].gindex), &index ); -
439 if ( error )
partially evaluated: error
TRUEFALSE
yes
Evaluation Count:411685
no
Evaluation Count:0
0-411685
440 return error;
executed: return error;
Execution Count:411685
411685
441 -
442 if ( index >= ms->SequenceCount )
never evaluated: index >= ms->SequenceCount
0
443 return _hb_err (HB_Err_Invalid_SubTable);
never executed: return _hb_err (HB_Err_Invalid_SubTable);
0
444 -
445 count = ms->Sequence[index].GlyphCount; -
446 s = ms->Sequence[index].Substitute; -
447 -
448 if ( ( ( error = _hb_buffer_add_output_glyphs( (buffer), (1), (count), (s), (0xFFFF), (0xFFFF) ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _hb_buffer_add_output_glyphs( (buffer), (1), (count), (s), (0xFFFF), (0xFFFF) ) ) != HB_Err_Ok )
0
449 return error;
never executed: return error;
0
450 -
451 if ( gdef && gdef->NewGlyphClasses )
never evaluated: gdef
never evaluated: gdef->NewGlyphClasses
0
452 { -
453 -
454 -
455 if ( property == 0x0004 )
never evaluated: property == 0x0004
0
456 property = 0x0002;
never executed: property = 0x0002;
0
457 -
458 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
459 { -
460 error = _HB_GDEF_Add_Glyph_Property( gdef, s[n], property ); -
461 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
462 return error;
never executed: return error;
0
463 }
never executed: }
0
464 }
never executed: }
0
465 -
466 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
467} -
468 -
469 -
470 -
471 -
472 -
473 -
474static HB_Error Load_AlternateSet( HB_AlternateSet* as, -
475 HB_Stream stream ) -
476{ -
477 HB_Error error; -
478 -
479 HB_UShort n, count; -
480 HB_UShort* a; -
481 -
482 -
483 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:733
0-733
484 return error;
never executed: return error;
0
485 -
486 count = as->GlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
487 -
488 _hb_stream_frame_exit( stream ); -
489 -
490 as->Alternate = ((void *)0); -
491 -
492 if ( ( (as->Alternate) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
partially evaluated: ( (as->Alternate) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:733
0-733
493 return error;
never executed: return error;
0
494 -
495 a = as->Alternate; -
496 -
497 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:733
0-733
498 { -
499 do { if ( (a) ) { _hb_free( a ); a = ((void *)0); } } while (0);
never evaluated: 0
never executed: }
never executed: }
never evaluated: (a)
0
500 return error;
never executed: return error;
0
501 } -
502 -
503 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:733
yes
Evaluation Count:733
733
504 a[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
executed: a[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
Execution Count:733
733
505 -
506 _hb_stream_frame_exit( stream ); -
507 -
508 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:733
733
509} -
510 -
511 -
512static void Free_AlternateSet( HB_AlternateSet* as ) -
513{ -
514 do { if ( (as->Alternate) ) { _hb_free( as->Alternate ); as->Alternate = ((void *)0); } } while (0);
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:697
executed: }
Execution Count:697
partially evaluated: (as->Alternate)
TRUEFALSE
yes
Evaluation Count:697
no
Evaluation Count:0
executed: }
Execution Count:697
0-697
515}
executed: }
Execution Count:697
697
516 -
517 -
518 -
519 -
520static HB_Error Load_AlternateSubst( HB_GSUB_SubTable* st, -
521 HB_Stream stream ) -
522{ -
523 HB_Error error; -
524 HB_AlternateSubst* as = &st->alternate; -
525 -
526 HB_UShort n = 0, m, count; -
527 HB_UInt cur_offset, new_offset, base_offset; -
528 -
529 HB_AlternateSet* aset; -
530 -
531 -
532 base_offset = _hb_stream_pos( stream ); -
533 -
534 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:123
0-123
535 return error;
never executed: return error;
0
536 -
537 as->SubstFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
538 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
539 -
540 _hb_stream_frame_exit( stream ); -
541 -
542 cur_offset = _hb_stream_pos( stream ); -
543 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:123
0-123
544 ( error = _HB_OPEN_Load_Coverage( &as->Coverage, stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_Coverage( &as->Coverage, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:123
0-123
545 return error;
never executed: return error;
0
546 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
547 -
548 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:123
0-123
549 goto Fail2;
never executed: goto Fail2;
0
550 -
551 count = as->AlternateSetCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
552 -
553 _hb_stream_frame_exit( stream ); -
554 -
555 as->AlternateSet = ((void *)0); -
556 -
557 if ( ( (as->AlternateSet) = _hb_alloc( (count)*sizeof(HB_AlternateSet), &error ), error != 0 ) )
partially evaluated: ( (as->AlternateSet) = _hb_alloc( (count)*sizeof(HB_AlternateSet), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:123
0-123
558 goto Fail2;
never executed: goto Fail2;
0
559 -
560 aset = as->AlternateSet; -
561 -
562 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:733
yes
Evaluation Count:123
123-733
563 { -
564 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:733
0-733
565 goto Fail1;
never executed: goto Fail1;
0
566 -
567 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
568 -
569 _hb_stream_frame_exit( stream ); -
570 -
571 cur_offset = _hb_stream_pos( stream ); -
572 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:733
0-733
573 ( error = Load_AlternateSet( &aset[n], stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_AlternateSet( &aset[n], stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:733
0-733
574 goto Fail1;
never executed: goto Fail1;
0
575 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
576 }
executed: }
Execution Count:733
733
577 -
578 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:123
123
579 -
580Fail1: -
581 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
582 Free_AlternateSet( &aset[m] );
never executed: Free_AlternateSet( &aset[m] );
0
583 -
584 do { if ( (aset) ) { _hb_free( aset ); aset = ((void *)0); } } while (0);
never executed: }
never executed: }
never evaluated: 0
never evaluated: (aset)
0
585 -
586Fail2:
code before this statement never executed: Fail2:
0
587 _HB_OPEN_Free_Coverage( &as->Coverage ); -
588 return error;
never executed: return error;
0
589} -
590 -
591 -
592static void Free_AlternateSubst( HB_GSUB_SubTable* st ) -
593{ -
594 HB_UShort n, count; -
595 HB_AlternateSubst* as = &st->alternate; -
596 -
597 HB_AlternateSet* aset; -
598 -
599 -
600 if ( as->AlternateSet )
partially evaluated: as->AlternateSet
TRUEFALSE
yes
Evaluation Count:117
no
Evaluation Count:0
0-117
601 { -
602 count = as->AlternateSetCount; -
603 aset = as->AlternateSet; -
604 -
605 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:697
yes
Evaluation Count:117
117-697
606 Free_AlternateSet( &aset[n] );
executed: Free_AlternateSet( &aset[n] );
Execution Count:697
697
607 -
608 do { if ( (aset) ) { _hb_free( aset ); aset = ((void *)0); } } while (0);
executed: }
Execution Count:117
executed: }
Execution Count:117
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:117
partially evaluated: (aset)
TRUEFALSE
yes
Evaluation Count:117
no
Evaluation Count:0
0-117
609 }
executed: }
Execution Count:117
117
610 -
611 _HB_OPEN_Free_Coverage( &as->Coverage ); -
612}
executed: }
Execution Count:117
117
613 -
614 -
615static HB_Error Lookup_AlternateSubst( HB_GSUBHeader* gsub, -
616 HB_GSUB_SubTable* st, -
617 HB_Buffer buffer, -
618 HB_UShort flags, -
619 HB_UShort context_length, -
620 int nesting_level ) -
621{ -
622 HB_Error error; -
623 HB_UShort index, value, alt_index, property; -
624 HB_AlternateSubst* as = &st->alternate; -
625 HB_GDEFHeader* gdef = gsub->gdef; -
626 HB_AlternateSet aset; -
627 -
628 ((nesting_level) = (nesting_level)); -
629 -
630 if ( context_length != 0xFFFF && context_length < 1 )
never evaluated: context_length != 0xFFFF
never evaluated: context_length < 1
0
631 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
632 -
633 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
634 return error;
never executed: return error;
0
635 -
636 error = _HB_OPEN_Coverage_Index( &as->Coverage, (buffer->in_string[buffer->in_pos].gindex), &index ); -
637 if ( error )
never evaluated: error
0
638 return error;
never executed: return error;
0
639 -
640 aset = as->AlternateSet[index]; -
641 -
642 -
643 -
644 if ( gsub->altfunc )
never evaluated: gsub->altfunc
0
645 alt_index = (gsub->altfunc)( buffer->out_pos, (buffer->in_string[buffer->in_pos].gindex), 0
646 aset.GlyphCount, aset.Alternate, 0
647 gsub->data );
never executed: alt_index = (gsub->altfunc)( buffer->out_pos, (buffer->in_string[buffer->in_pos].gindex), aset.GlyphCount, aset.Alternate, gsub->data );
0
648 else -
649 alt_index = 0;
never executed: alt_index = 0;
0
650 -
651 value = aset.Alternate[alt_index]; -
652 if ( ( ( error = _hb_buffer_replace_output_glyph( (buffer), (value), (nesting_level) == 1 ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _hb_buffer_replace_output_glyph( (buffer), (value), (nesting_level) == 1 ) ) != HB_Err_Ok )
0
653 return error;
never executed: return error;
0
654 -
655 if ( gdef && gdef->NewGlyphClasses )
never evaluated: gdef
never evaluated: gdef->NewGlyphClasses
0
656 { -
657 -
658 -
659 error = _HB_GDEF_Add_Glyph_Property( gdef, value, property ); -
660 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
661 return error;
never executed: return error;
0
662 }
never executed: }
0
663 -
664 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
665} -
666 -
667 -
668 -
669 -
670 -
671 -
672static HB_Error Load_Ligature( HB_Ligature* l, -
673 HB_Stream stream ) -
674{ -
675 HB_Error error; -
676 -
677 HB_UShort n, count; -
678 HB_UShort* c; -
679 -
680 -
681 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:17863
0-17863
682 return error;
never executed: return error;
0
683 -
684 l->LigGlyph = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
685 l->ComponentCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
686 -
687 _hb_stream_frame_exit( stream ); -
688 -
689 l->Component = ((void *)0); -
690 -
691 count = l->ComponentCount - 1; -
692 -
693 if ( ( (l->Component) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
partially evaluated: ( (l->Component) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:17863
0-17863
694 return error;
never executed: return error;
0
695 -
696 c = l->Component; -
697 -
698 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:17863
0-17863
699 { -
700 do { if ( (c) ) { _hb_free( c ); c = ((void *)0); } } while (0);
never executed: }
never executed: }
never evaluated: 0
never evaluated: (c)
0
701 return error;
never executed: return error;
0
702 } -
703 -
704 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:19535
yes
Evaluation Count:17863
17863-19535
705 c[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
executed: c[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
Execution Count:19535
19535
706 -
707 _hb_stream_frame_exit( stream ); -
708 -
709 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:17863
17863
710} -
711 -
712 -
713static void Free_Ligature( HB_Ligature* l ) -
714{ -
715 do { if ( (l->Component) ) { _hb_free( l->Component ); l->Component = ((void *)0); } } while (0);
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:17229
executed: }
Execution Count:17229
executed: }
Execution Count:17229
partially evaluated: (l->Component)
TRUEFALSE
yes
Evaluation Count:17229
no
Evaluation Count:0
0-17229
716}
executed: }
Execution Count:17229
17229
717 -
718 -
719 -
720 -
721static HB_Error Load_LigatureSet( HB_LigatureSet* ls, -
722 HB_Stream stream ) -
723{ -
724 HB_Error error; -
725 -
726 HB_UShort n = 0, m, count; -
727 HB_UInt cur_offset, new_offset, base_offset; -
728 -
729 HB_Ligature* l; -
730 -
731 -
732 base_offset = _hb_stream_pos( stream ); -
733 -
734 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:9759
0-9759
735 return error;
never executed: return error;
0
736 -
737 count = ls->LigatureCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
738 -
739 _hb_stream_frame_exit( stream ); -
740 -
741 ls->Ligature = ((void *)0); -
742 -
743 if ( ( (ls->Ligature) = _hb_alloc( (count)*sizeof(HB_Ligature), &error ), error != 0 ) )
partially evaluated: ( (ls->Ligature) = _hb_alloc( (count)*sizeof(HB_Ligature), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9759
0-9759
744 return error;
never executed: return error;
0
745 -
746 l = ls->Ligature; -
747 -
748 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:17863
yes
Evaluation Count:9759
9759-17863
749 { -
750 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:17863
0-17863
751 goto Fail;
never executed: goto Fail;
0
752 -
753 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
754 -
755 _hb_stream_frame_exit( stream ); -
756 -
757 cur_offset = _hb_stream_pos( stream ); -
758 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:17863
0-17863
759 ( error = Load_Ligature( &l[n], stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_Ligature( &l[n], stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:17863
0-17863
760 goto Fail;
never executed: goto Fail;
0
761 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
762 }
executed: }
Execution Count:17863
17863
763 -
764 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:9759
9759
765 -
766Fail: -
767 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
768 Free_Ligature( &l[m] );
never executed: Free_Ligature( &l[m] );
0
769 -
770 do { if ( (l) ) { _hb_free( l ); l = ((void *)0); } } while (0);
never evaluated: 0
never executed: }
never executed: }
never evaluated: (l)
0
771 return error;
never executed: return error;
0
772} -
773 -
774 -
775static void Free_LigatureSet( HB_LigatureSet* ls ) -
776{ -
777 HB_UShort n, count; -
778 -
779 HB_Ligature* l; -
780 -
781 -
782 if ( ls->Ligature )
partially evaluated: ls->Ligature
TRUEFALSE
yes
Evaluation Count:9406
no
Evaluation Count:0
0-9406
783 { -
784 count = ls->LigatureCount; -
785 l = ls->Ligature; -
786 -
787 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:17229
yes
Evaluation Count:9406
9406-17229
788 Free_Ligature( &l[n] );
executed: Free_Ligature( &l[n] );
Execution Count:17229
17229
789 -
790 do { if ( (l) ) { _hb_free( l ); l = ((void *)0); } } while (0);
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9406
executed: }
Execution Count:9406
executed: }
Execution Count:9406
partially evaluated: (l)
TRUEFALSE
yes
Evaluation Count:9406
no
Evaluation Count:0
0-9406
791 }
executed: }
Execution Count:9406
9406
792}
executed: }
Execution Count:9406
9406
793 -
794 -
795 -
796 -
797static HB_Error Load_LigatureSubst( HB_GSUB_SubTable* st, -
798 HB_Stream stream ) -
799{ -
800 HB_Error error; -
801 HB_LigatureSubst* ls = &st->ligature; -
802 -
803 HB_UShort n = 0, m, count; -
804 HB_UInt cur_offset, new_offset, base_offset; -
805 -
806 HB_LigatureSet* lset; -
807 -
808 -
809 base_offset = _hb_stream_pos( stream ); -
810 -
811 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:1632
0-1632
812 return error;
never executed: return error;
0
813 -
814 ls->SubstFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
815 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
816 -
817 _hb_stream_frame_exit( stream ); -
818 -
819 cur_offset = _hb_stream_pos( stream ); -
820 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:1632
0-1632
821 ( error = _HB_OPEN_Load_Coverage( &ls->Coverage, stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_Coverage( &ls->Coverage, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1632
0-1632
822 return error;
never executed: return error;
0
823 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
824 -
825 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:1632
0-1632
826 goto Fail2;
never executed: goto Fail2;
0
827 -
828 count = ls->LigatureSetCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
829 -
830 _hb_stream_frame_exit( stream ); -
831 -
832 ls->LigatureSet = ((void *)0); -
833 -
834 if ( ( (ls->LigatureSet) = _hb_alloc( (count)*sizeof(HB_LigatureSet), &error ), error != 0 ) )
partially evaluated: ( (ls->LigatureSet) = _hb_alloc( (count)*sizeof(HB_LigatureSet), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1632
0-1632
835 goto Fail2;
never executed: goto Fail2;
0
836 -
837 lset = ls->LigatureSet; -
838 -
839 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:9759
yes
Evaluation Count:1632
1632-9759
840 { -
841 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:9759
0-9759
842 goto Fail1;
never executed: goto Fail1;
0
843 -
844 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
845 -
846 _hb_stream_frame_exit( stream ); -
847 -
848 cur_offset = _hb_stream_pos( stream ); -
849 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:9759
0-9759
850 ( error = Load_LigatureSet( &lset[n], stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_LigatureSet( &lset[n], stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9759
0-9759
851 goto Fail1;
never executed: goto Fail1;
0
852 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
853 }
executed: }
Execution Count:9759
9759
854 -
855 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:1632
1632
856 -
857Fail1: -
858 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
859 Free_LigatureSet( &lset[m] );
never executed: Free_LigatureSet( &lset[m] );
0
860 -
861 do { if ( (lset) ) { _hb_free( lset ); lset = ((void *)0); } } while (0);
never evaluated: 0
never executed: }
never executed: }
never evaluated: (lset)
0
862 -
863Fail2:
code before this statement never executed: Fail2:
0
864 _HB_OPEN_Free_Coverage( &ls->Coverage ); -
865 return error;
never executed: return error;
0
866} -
867 -
868 -
869static void Free_LigatureSubst( HB_GSUB_SubTable* st ) -
870{ -
871 HB_UShort n, count; -
872 HB_LigatureSubst* ls = &st->ligature; -
873 -
874 HB_LigatureSet* lset; -
875 -
876 -
877 if ( ls->LigatureSet )
partially evaluated: ls->LigatureSet
TRUEFALSE
yes
Evaluation Count:1557
no
Evaluation Count:0
0-1557
878 { -
879 count = ls->LigatureSetCount; -
880 lset = ls->LigatureSet; -
881 -
882 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:9406
yes
Evaluation Count:1557
1557-9406
883 Free_LigatureSet( &lset[n] );
executed: Free_LigatureSet( &lset[n] );
Execution Count:9406
9406
884 -
885 do { if ( (lset) ) { _hb_free( lset ); lset = ((void *)0); } } while (0);
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1557
executed: }
Execution Count:1557
executed: }
Execution Count:1557
partially evaluated: (lset)
TRUEFALSE
yes
Evaluation Count:1557
no
Evaluation Count:0
0-1557
886 }
executed: }
Execution Count:1557
1557
887 -
888 _HB_OPEN_Free_Coverage( &ls->Coverage ); -
889}
executed: }
Execution Count:1557
1557
890 -
891 -
892static HB_Error Lookup_LigatureSubst( HB_GSUBHeader* gsub, -
893 HB_GSUB_SubTable* st, -
894 HB_Buffer buffer, -
895 HB_UShort flags, -
896 HB_UShort context_length, -
897 int nesting_level ) -
898{ -
899 HB_UShort index, property; -
900 HB_Error error; -
901 HB_UShort numlig, i, j, is_mark, first_is_mark = 0; -
902 HB_UShort* c; -
903 HB_LigatureSubst* ls = &st->ligature; -
904 HB_GDEFHeader* gdef = gsub->gdef; -
905 -
906 HB_Ligature* lig; -
907 -
908 ((nesting_level) = (nesting_level)); -
909 -
910 if ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok ) )
partially evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3316494
0-3316494
911 return error;
never executed: return error;
0
912 -
913 if ( property == 0x0008 || property & 0xFF00 )
evaluated: property == 0x0008
TRUEFALSE
yes
Evaluation Count:204985
yes
Evaluation Count:3111509
partially evaluated: property & 0xFF00
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3111509
0-3111509
914 first_is_mark = (!0);
executed: first_is_mark = (!0);
Execution Count:204985
204985
915 -
916 error = _HB_OPEN_Coverage_Index( &ls->Coverage, (buffer->in_string[buffer->in_pos].gindex), &index ); -
917 if ( error )
evaluated: error
TRUEFALSE
yes
Evaluation Count:3296699
yes
Evaluation Count:19795
19795-3296699
918 return error;
executed: return error;
Execution Count:3296699
3296699
919 -
920 if ( index >= ls->LigatureSetCount )
partially evaluated: index >= ls->LigatureSetCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:19795
0-19795
921 return _hb_err (HB_Err_Invalid_SubTable);
never executed: return _hb_err (HB_Err_Invalid_SubTable);
0
922 -
923 lig = ls->LigatureSet[index].Ligature; -
924 -
925 for ( numlig = ls->LigatureSet[index].LigatureCount; -
926 numlig;
evaluated: numlig
TRUEFALSE
yes
Evaluation Count:87908
yes
Evaluation Count:9816
9816-87908
927 numlig--, lig++ ) -
928 { -
929 if ( buffer->in_pos + lig->ComponentCount > buffer->in_length )
evaluated: buffer->in_pos + lig->ComponentCount > buffer->in_length
TRUEFALSE
yes
Evaluation Count:3815
yes
Evaluation Count:84093
3815-84093
930 goto next_ligature;
executed: goto next_ligature;
Execution Count:3815
3815
931 -
932 c = lig->Component; -
933 -
934 is_mark = first_is_mark; -
935 -
936 if ( context_length != 0xFFFF && context_length < lig->ComponentCount )
partially evaluated: context_length != 0xFFFF
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:84093
never evaluated: context_length < lig->ComponentCount
0-84093
937 break;
never executed: break;
0
938 -
939 for ( i = 1, j = buffer->in_pos + 1; i < lig->ComponentCount; i++, j++ )
evaluated: i < lig->ComponentCount
TRUEFALSE
yes
Evaluation Count:84541
yes
Evaluation Count:9979
9979-84541
940 { -
941 while ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok ) )
partially evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:84541
0-84541
942 { -
943 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
944 return error;
never executed: return error;
0
945 -
946 if ( j + lig->ComponentCount - i == (HB_Int)buffer->in_length )
never evaluated: j + lig->ComponentCount - i == (HB_Int)buffer->in_length
0
947 goto next_ligature;
never executed: goto next_ligature;
0
948 j++; -
949 }
never executed: }
0
950 -
951 if ( !( property == 0x0008 || property & 0xFF00 ) )
partially evaluated: property == 0x0008
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:84541
partially evaluated: property & 0xFF00
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:84541
0-84541
952 is_mark = 0;
executed: is_mark = 0;
Execution Count:84541
84541
953 -
954 if ( (buffer->in_string[(j)].gindex) != c[i - 1] )
evaluated: (buffer->in_string[(j)].gindex) != c[i - 1]
TRUEFALSE
yes
Evaluation Count:74114
yes
Evaluation Count:10427
10427-74114
955 goto next_ligature;
executed: goto next_ligature;
Execution Count:74114
74114
956 }
executed: }
Execution Count:10427
10427
957 -
958 if ( gdef && gdef->NewGlyphClasses )
partially evaluated: gdef
TRUEFALSE
yes
Evaluation Count:9979
no
Evaluation Count:0
partially evaluated: gdef->NewGlyphClasses
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9979
0-9979
959 { -
960 -
961 -
962 error = _HB_GDEF_Add_Glyph_Property( gdef, lig->LigGlyph, -
963 is_mark ? 0x0008 : 0x0004 ); -
964 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
965 return error;
never executed: return error;
0
966 }
never executed: }
0
967 -
968 if ( j == buffer->in_pos + i )
partially evaluated: j == buffer->in_pos + i
TRUEFALSE
yes
Evaluation Count:9979
no
Evaluation Count:0
0-9979
969 { -
970 -
971 -
972 -
973 if ( (buffer->in_string[(buffer->in_pos)].ligID) )
partially evaluated: (buffer->in_string[(buffer->in_pos)].ligID)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9979
0-9979
974 { -
975 if ( ( ( error = _hb_buffer_add_output_glyphs( (buffer), (i), (1), (&lig->LigGlyph), (0xFFFF), (0xFFFF) ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _hb_buffer_add_output_glyphs( (buffer), (i), (1), (&lig->LigGlyph), (0xFFFF), (0xFFFF) ) ) != HB_Err_Ok )
0
976 -
977 return error;
never executed: return error;
0
978 }
never executed: }
0
979 else -
980 { -
981 HB_UShort ligID = _hb_buffer_allocate_ligid( buffer ); -
982 if ( ( ( error = _hb_buffer_add_output_glyphs( (buffer), (i), (1), (&lig->LigGlyph), (0xFFFF), (ligID) ) ) != HB_Err_Ok ) )
partially evaluated: ( ( error = _hb_buffer_add_output_glyphs( (buffer), (i), (1), (&lig->LigGlyph), (0xFFFF), (ligID) ) ) != HB_Err_Ok )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9979
0-9979
983 -
984 return error;
never executed: return error;
0
985 }
executed: }
Execution Count:9979
9979
986 } -
987 else -
988 { -
989 HB_UShort ligID = _hb_buffer_allocate_ligid( buffer ); -
990 if ( ( ( error = _hb_buffer_add_output_glyph( (buffer), (lig->LigGlyph), (0xFFFF), (ligID) ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _hb_buffer_add_output_glyph( (buffer), (lig->LigGlyph), (0xFFFF), (ligID) ) ) != HB_Err_Ok )
0
991 return error;
never executed: return error;
0
992 for ( i = 0; i < lig->ComponentCount - 1; i++ )
never evaluated: i < lig->ComponentCount - 1
0
993 { -
994 while ( ( ( 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
995 -
996 if ( ( ( error = _hb_buffer_add_output_glyph( (buffer), ((buffer->in_string[buffer->in_pos].gindex)), (i), (ligID) ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _hb_buffer_add_output_glyph( (buffer), ((buffer->in_string[buffer->in_pos].gindex)), (i), (ligID) ) ) != HB_Err_Ok )
0
997 return error;
never executed: return error;
0
998 -
999 (buffer->in_pos)++; -
1000 }
never executed: }
0
1001 }
never executed: }
0
1002 -
1003 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:9979
9979
1004 -
1005 next_ligature: -
1006 ; -
1007 }
executed: }
Execution Count:77929
77929
1008 -
1009 return HB_Err_Not_Covered;
executed: return HB_Err_Not_Covered;
Execution Count:9816
9816
1010} -
1011 -
1012 -
1013 -
1014 -
1015 -
1016 -
1017static HB_Error Do_ContextSubst( HB_GSUBHeader* gsub, -
1018 HB_UShort GlyphCount, -
1019 HB_UShort SubstCount, -
1020 HB_SubstLookupRecord* subst, -
1021 HB_Buffer buffer, -
1022 int nesting_level ) -
1023{ -
1024 HB_Error error; -
1025 HB_UInt i, old_pos; -
1026 -
1027 -
1028 i = 0; -
1029 -
1030 while ( i < GlyphCount )
never evaluated: i < GlyphCount
0
1031 { -
1032 if ( SubstCount && i == subst->SequenceIndex )
never evaluated: SubstCount
never evaluated: i == subst->SequenceIndex
0
1033 { -
1034 old_pos = buffer->in_pos; -
1035 -
1036 -
1037 -
1038 error = GSUB_Do_Glyph_Lookup( gsub, subst->LookupListIndex, buffer, -
1039 GlyphCount, nesting_level ); -
1040 -
1041 subst++; -
1042 SubstCount--; -
1043 i += buffer->in_pos - old_pos; -
1044 -
1045 if ( error == HB_Err_Not_Covered )
never evaluated: error == HB_Err_Not_Covered
0
1046 { -
1047 if ( ( (error = _hb_buffer_copy_output_glyph ( buffer ) ) != HB_Err_Ok ) )
never evaluated: ( (error = _hb_buffer_copy_output_glyph ( buffer ) ) != HB_Err_Ok )
0
1048 return error;
never executed: return error;
0
1049 i++; -
1050 }
never executed: }
0
1051 else if ( error )
never evaluated: error
0
1052 return error;
never executed: return error;
0
1053 } -
1054 else -
1055 { -
1056 -
1057 -
1058 if ( ( (error = _hb_buffer_copy_output_glyph ( buffer ) ) != HB_Err_Ok ) )
never evaluated: ( (error = _hb_buffer_copy_output_glyph ( buffer ) ) != HB_Err_Ok )
0
1059 return error;
never executed: return error;
0
1060 i++; -
1061 }
never executed: }
0
1062 } -
1063 -
1064 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1065} -
1066 -
1067 -
1068 -
1069 -
1070 -
1071 -
1072static HB_Error Load_SubRule( HB_SubRule* sr, -
1073 HB_Stream stream ) -
1074{ -
1075 HB_Error error; -
1076 -
1077 HB_UShort n, count; -
1078 HB_UShort* i; -
1079 -
1080 HB_SubstLookupRecord* slr; -
1081 -
1082 -
1083 if ( ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
0
1084 return error;
never executed: return error;
0
1085 -
1086 sr->GlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1087 sr->SubstCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1088 -
1089 _hb_stream_frame_exit( stream ); -
1090 -
1091 sr->Input = ((void *)0); -
1092 -
1093 count = sr->GlyphCount - 1; -
1094 -
1095 if ( ( (sr->Input) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
never evaluated: ( (sr->Input) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
0
1096 return error;
never executed: return error;
0
1097 -
1098 i = sr->Input; -
1099 -
1100 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
0
1101 goto Fail2;
never executed: goto Fail2;
0
1102 -
1103 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1104 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
1105 -
1106 _hb_stream_frame_exit( stream ); -
1107 -
1108 sr->SubstLookupRecord = ((void *)0); -
1109 -
1110 count = sr->SubstCount; -
1111 -
1112 if ( ( (sr->SubstLookupRecord) = _hb_alloc( (count)*sizeof(HB_SubstLookupRecord), &error ), error != 0 ) )
never evaluated: ( (sr->SubstLookupRecord) = _hb_alloc( (count)*sizeof(HB_SubstLookupRecord), &error ), error != 0 )
0
1113 goto Fail2;
never executed: goto Fail2;
0
1114 -
1115 slr = sr->SubstLookupRecord; -
1116 -
1117 if ( ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 )
0
1118 goto Fail1;
never executed: goto Fail1;
0
1119 -
1120 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1121 { -
1122 slr[n].SequenceIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1123 slr[n].LookupListIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1124 }
never executed: }
0
1125 -
1126 _hb_stream_frame_exit( stream ); -
1127 -
1128 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1129 -
1130Fail1: -
1131 do { if ( (slr) ) { _hb_free( slr ); slr = ((void *)0); } } while (0);
never evaluated: 0
never executed: }
never executed: }
never evaluated: (slr)
0
1132 -
1133Fail2:
code before this statement never executed: Fail2:
0
1134 do { if ( (i) ) { _hb_free( i ); i = ((void *)0); } } while (0);
never evaluated: 0
never executed: }
never executed: }
never evaluated: (i)
0
1135 return error;
never executed: return error;
0
1136} -
1137 -
1138 -
1139static void Free_SubRule( HB_SubRule* sr ) -
1140{ -
1141 do { if ( (sr->SubstLookupRecord) ) { _hb_free( sr->SubstLookupRecord ); sr->SubstLookupRecord = ((void *)0); } } while (0);
never evaluated: 0
never executed: }
never executed: }
never evaluated: (sr->SubstLookupRecord)
0
1142 do { if ( (sr->Input) ) { _hb_free( sr->Input ); sr->Input = ((void *)0); } } while (0);
never evaluated: 0
never executed: }
never executed: }
never evaluated: (sr->Input)
0
1143}
never executed: }
0
1144 -
1145 -
1146 -
1147 -
1148static HB_Error Load_SubRuleSet( HB_SubRuleSet* srs, -
1149 HB_Stream stream ) -
1150{ -
1151 HB_Error error; -
1152 -
1153 HB_UShort n = 0, m, count; -
1154 HB_UInt cur_offset, new_offset, base_offset; -
1155 -
1156 HB_SubRule* sr; -
1157 -
1158 -
1159 base_offset = _hb_stream_pos( stream ); -
1160 -
1161 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
1162 return error;
never executed: return error;
0
1163 -
1164 count = srs->SubRuleCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1165 -
1166 _hb_stream_frame_exit( stream ); -
1167 -
1168 srs->SubRule = ((void *)0); -
1169 -
1170 if ( ( (srs->SubRule) = _hb_alloc( (count)*sizeof(HB_SubRule), &error ), error != 0 ) )
never evaluated: ( (srs->SubRule) = _hb_alloc( (count)*sizeof(HB_SubRule), &error ), error != 0 )
0
1171 return error;
never executed: return error;
0
1172 -
1173 sr = srs->SubRule; -
1174 -
1175 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1176 { -
1177 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
1178 goto Fail;
never executed: goto Fail;
0
1179 -
1180 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
1181 -
1182 _hb_stream_frame_exit( stream ); -
1183 -
1184 cur_offset = _hb_stream_pos( stream ); -
1185 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
1186 ( error = Load_SubRule( &sr[n], stream ) ) != HB_Err_Ok )
never evaluated: ( error = Load_SubRule( &sr[n], stream ) ) != HB_Err_Ok
0
1187 goto Fail;
never executed: goto Fail;
0
1188 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
1189 }
never executed: }
0
1190 -
1191 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1192 -
1193Fail: -
1194 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
1195 Free_SubRule( &sr[m] );
never executed: Free_SubRule( &sr[m] );
0
1196 -
1197 do { if ( (sr) ) { _hb_free( sr ); sr = ((void *)0); } } while (0);
never evaluated: 0
never executed: }
never executed: }
never evaluated: (sr)
0
1198 return error;
never executed: return error;
0
1199} -
1200 -
1201 -
1202static void Free_SubRuleSet( HB_SubRuleSet* srs ) -
1203{ -
1204 HB_UShort n, count; -
1205 -
1206 HB_SubRule* sr; -
1207 -
1208 -
1209 if ( srs->SubRule )
never evaluated: srs->SubRule
0
1210 { -
1211 count = srs->SubRuleCount; -
1212 sr = srs->SubRule; -
1213 -
1214 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1215 Free_SubRule( &sr[n] );
never executed: Free_SubRule( &sr[n] );
0
1216 -
1217 do { if ( (sr) ) { _hb_free( sr ); sr = ((void *)0); } } while (0);
never evaluated: 0
never executed: }
never executed: }
never evaluated: (sr)
0
1218 }
never executed: }
0
1219}
never executed: }
0
1220 -
1221 -
1222 -
1223 -
1224static HB_Error Load_ContextSubst1( HB_ContextSubstFormat1* csf1, -
1225 HB_Stream stream ) -
1226{ -
1227 HB_Error error; -
1228 -
1229 HB_UShort n = 0, m, count; -
1230 HB_UInt cur_offset, new_offset, base_offset; -
1231 -
1232 HB_SubRuleSet* srs; -
1233 -
1234 -
1235 base_offset = _hb_stream_pos( stream ) - 2L; -
1236 -
1237 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
1238 return error;
never executed: return error;
0
1239 -
1240 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
1241 -
1242 _hb_stream_frame_exit( stream ); -
1243 -
1244 cur_offset = _hb_stream_pos( stream ); -
1245 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
1246 ( error = _HB_OPEN_Load_Coverage( &csf1->Coverage, stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Coverage( &csf1->Coverage, stream ) ) != HB_Err_Ok
0
1247 return error;
never executed: return error;
0
1248 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
1249 -
1250 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
1251 goto Fail2;
never executed: goto Fail2;
0
1252 -
1253 count = csf1->SubRuleSetCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1254 -
1255 _hb_stream_frame_exit( stream ); -
1256 -
1257 csf1->SubRuleSet = ((void *)0); -
1258 -
1259 if ( ( (csf1->SubRuleSet) = _hb_alloc( (count)*sizeof(HB_SubRuleSet), &error ), error != 0 ) )
never evaluated: ( (csf1->SubRuleSet) = _hb_alloc( (count)*sizeof(HB_SubRuleSet), &error ), error != 0 )
0
1260 goto Fail2;
never executed: goto Fail2;
0
1261 -
1262 srs = csf1->SubRuleSet; -
1263 -
1264 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1265 { -
1266 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
1267 goto Fail1;
never executed: goto Fail1;
0
1268 -
1269 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
1270 -
1271 _hb_stream_frame_exit( stream ); -
1272 -
1273 cur_offset = _hb_stream_pos( stream ); -
1274 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
1275 ( error = Load_SubRuleSet( &srs[n], stream ) ) != HB_Err_Ok )
never evaluated: ( error = Load_SubRuleSet( &srs[n], stream ) ) != HB_Err_Ok
0
1276 goto Fail1;
never executed: goto Fail1;
0
1277 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
1278 }
never executed: }
0
1279 -
1280 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1281 -
1282Fail1: -
1283 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
1284 Free_SubRuleSet( &srs[m] );
never executed: Free_SubRuleSet( &srs[m] );
0
1285 -
1286 do { if ( (srs) ) { _hb_free( srs ); srs = ((void *)0); } } while (0);
never evaluated: (srs)
never evaluated: 0
never executed: }
never executed: }
0
1287 -
1288Fail2:
code before this statement never executed: Fail2:
0
1289 _HB_OPEN_Free_Coverage( &csf1->Coverage ); -
1290 return error;
never executed: return error;
0
1291} -
1292 -
1293 -
1294static void Free_ContextSubst1( HB_ContextSubstFormat1* csf1 ) -
1295{ -
1296 HB_UShort n, count; -
1297 -
1298 HB_SubRuleSet* srs; -
1299 -
1300 -
1301 if ( csf1->SubRuleSet )
never evaluated: csf1->SubRuleSet
0
1302 { -
1303 count = csf1->SubRuleSetCount; -
1304 srs = csf1->SubRuleSet; -
1305 -
1306 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1307 Free_SubRuleSet( &srs[n] );
never executed: Free_SubRuleSet( &srs[n] );
0
1308 -
1309 do { if ( (srs) ) { _hb_free( srs ); srs = ((void *)0); } } while (0);
never evaluated: (srs)
never evaluated: 0
never executed: }
never executed: }
0
1310 }
never executed: }
0
1311 -
1312 _HB_OPEN_Free_Coverage( &csf1->Coverage ); -
1313}
never executed: }
0
1314 -
1315 -
1316 -
1317 -
1318static HB_Error Load_SubClassRule( HB_ContextSubstFormat2* csf2, -
1319 HB_SubClassRule* scr, -
1320 HB_Stream stream ) -
1321{ -
1322 HB_Error error; -
1323 -
1324 HB_UShort n, count; -
1325 -
1326 HB_UShort* c; -
1327 HB_SubstLookupRecord* slr; -
1328 -
1329 -
1330 if ( ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
0
1331 return error;
never executed: return error;
0
1332 -
1333 scr->GlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1334 scr->SubstCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1335 -
1336 if ( scr->GlyphCount > csf2->MaxContextLength )
never evaluated: scr->GlyphCount > csf2->MaxContextLength
0
1337 csf2->MaxContextLength = scr->GlyphCount;
never executed: csf2->MaxContextLength = scr->GlyphCount;
0
1338 -
1339 _hb_stream_frame_exit( stream ); -
1340 -
1341 scr->Class = ((void *)0); -
1342 -
1343 count = scr->GlyphCount - 1; -
1344 -
1345 if ( ( (scr->Class) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
never evaluated: ( (scr->Class) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
0
1346 return error;
never executed: return error;
0
1347 -
1348 c = scr->Class; -
1349 -
1350 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
0
1351 goto Fail2;
never executed: goto Fail2;
0
1352 -
1353 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1354 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
1355 -
1356 _hb_stream_frame_exit( stream ); -
1357 -
1358 scr->SubstLookupRecord = ((void *)0); -
1359 -
1360 count = scr->SubstCount; -
1361 -
1362 if ( ( (scr->SubstLookupRecord) = _hb_alloc( (count)*sizeof(HB_SubstLookupRecord), &error ), error != 0 ) )
never evaluated: ( (scr->SubstLookupRecord) = _hb_alloc( (count)*sizeof(HB_SubstLookupRecord), &error ), error != 0 )
0
1363 goto Fail2;
never executed: goto Fail2;
0
1364 -
1365 slr = scr->SubstLookupRecord; -
1366 -
1367 if ( ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 )
0
1368 goto Fail1;
never executed: goto Fail1;
0
1369 -
1370 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1371 { -
1372 slr[n].SequenceIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1373 slr[n].LookupListIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1374 }
never executed: }
0
1375 -
1376 _hb_stream_frame_exit( stream ); -
1377 -
1378 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1379 -
1380Fail1: -
1381 do { if ( (slr) ) { _hb_free( slr ); slr = ((void *)0); } } while (0);
never evaluated: (slr)
never evaluated: 0
never executed: }
never executed: }
0
1382 -
1383Fail2:
code before this statement never executed: Fail2:
0
1384 do { if ( (c) ) { _hb_free( c ); c = ((void *)0); } } while (0);
never evaluated: (c)
never evaluated: 0
never executed: }
never executed: }
0
1385 return error;
never executed: return error;
0
1386} -
1387 -
1388 -
1389static void Free_SubClassRule( HB_SubClassRule* scr ) -
1390{ -
1391 do { if ( (scr->SubstLookupRecord) ) { _hb_free( scr->SubstLookupRecord ); scr->SubstLookupRecord = ((void *)0); } } while (0);
never evaluated: (scr->SubstLookupRecord)
never evaluated: 0
never executed: }
never executed: }
0
1392 do { if ( (scr->Class) ) { _hb_free( scr->Class ); scr->Class = ((void *)0); } } while (0);
never evaluated: (scr->Class)
never evaluated: 0
never executed: }
never executed: }
0
1393}
never executed: }
0
1394 -
1395 -
1396 -
1397 -
1398static HB_Error Load_SubClassSet( HB_ContextSubstFormat2* csf2, -
1399 HB_SubClassSet* scs, -
1400 HB_Stream stream ) -
1401{ -
1402 HB_Error error; -
1403 -
1404 HB_UShort n = 0, m, count; -
1405 HB_UInt cur_offset, new_offset, base_offset; -
1406 -
1407 HB_SubClassRule* scr; -
1408 -
1409 -
1410 base_offset = _hb_stream_pos( stream ); -
1411 -
1412 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
1413 return error;
never executed: return error;
0
1414 -
1415 count = scs->SubClassRuleCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1416 -
1417 _hb_stream_frame_exit( stream ); -
1418 -
1419 scs->SubClassRule = ((void *)0); -
1420 -
1421 if ( ( (scs->SubClassRule) = _hb_alloc( (count)*sizeof(HB_SubClassRule), &error ), error != 0 ) )
never evaluated: ( (scs->SubClassRule) = _hb_alloc( (count)*sizeof(HB_SubClassRule), &error ), error != 0 )
0
1422 return error;
never executed: return error;
0
1423 -
1424 scr = scs->SubClassRule; -
1425 -
1426 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1427 { -
1428 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
1429 goto Fail;
never executed: goto Fail;
0
1430 -
1431 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
1432 -
1433 _hb_stream_frame_exit( stream ); -
1434 -
1435 cur_offset = _hb_stream_pos( stream ); -
1436 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
1437 ( error = Load_SubClassRule( csf2, &scr[n], 0
1438 stream ) ) != HB_Err_Ok )
never evaluated: ( error = Load_SubClassRule( csf2, &scr[n], stream ) ) != HB_Err_Ok
0
1439 goto Fail;
never executed: goto Fail;
0
1440 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
1441 }
never executed: }
0
1442 -
1443 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1444 -
1445Fail: -
1446 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
1447 Free_SubClassRule( &scr[m] );
never executed: Free_SubClassRule( &scr[m] );
0
1448 -
1449 do { if ( (scr) ) { _hb_free( scr ); scr = ((void *)0); } } while (0);
never evaluated: (scr)
never evaluated: 0
never executed: }
never executed: }
0
1450 return error;
never executed: return error;
0
1451} -
1452 -
1453 -
1454static void Free_SubClassSet( HB_SubClassSet* scs ) -
1455{ -
1456 HB_UShort n, count; -
1457 -
1458 HB_SubClassRule* scr; -
1459 -
1460 -
1461 if ( scs->SubClassRule )
never evaluated: scs->SubClassRule
0
1462 { -
1463 count = scs->SubClassRuleCount; -
1464 scr = scs->SubClassRule; -
1465 -
1466 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1467 Free_SubClassRule( &scr[n] );
never executed: Free_SubClassRule( &scr[n] );
0
1468 -
1469 do { if ( (scr) ) { _hb_free( scr ); scr = ((void *)0); } } while (0);
never evaluated: (scr)
never evaluated: 0
never executed: }
never executed: }
0
1470 }
never executed: }
0
1471}
never executed: }
0
1472 -
1473 -
1474 -
1475 -
1476static HB_Error Load_ContextSubst2( HB_ContextSubstFormat2* csf2, -
1477 HB_Stream stream ) -
1478{ -
1479 HB_Error error; -
1480 -
1481 HB_UShort n = 0, m, count; -
1482 HB_UInt cur_offset, new_offset, base_offset; -
1483 -
1484 HB_SubClassSet* scs; -
1485 -
1486 -
1487 base_offset = _hb_stream_pos( stream ) - 2; -
1488 -
1489 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
1490 return error;
never executed: return error;
0
1491 -
1492 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
1493 -
1494 _hb_stream_frame_exit( stream ); -
1495 -
1496 cur_offset = _hb_stream_pos( stream ); -
1497 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
1498 ( error = _HB_OPEN_Load_Coverage( &csf2->Coverage, stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Coverage( &csf2->Coverage, stream ) ) != HB_Err_Ok
0
1499 return error;
never executed: return error;
0
1500 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
1501 -
1502 if ( ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
0
1503 goto Fail3;
never executed: goto Fail3;
0
1504 -
1505 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
1506 -
1507 -
1508 -
1509 -
1510 count = csf2->SubClassSetCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1511 -
1512 _hb_stream_frame_exit( stream ); -
1513 -
1514 cur_offset = _hb_stream_pos( stream ); -
1515 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
1516 ( error = _HB_OPEN_Load_ClassDefinition( &csf2->ClassDef, count, 0
1517 stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_ClassDefinition( &csf2->ClassDef, count, stream ) ) != HB_Err_Ok
0
1518 goto Fail3;
never executed: goto Fail3;
0
1519 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
1520 -
1521 csf2->SubClassSet = ((void *)0); -
1522 csf2->MaxContextLength = 0; -
1523 -
1524 if ( ( (csf2->SubClassSet) = _hb_alloc( (count)*sizeof(HB_SubClassSet), &error ), error != 0 ) )
never evaluated: ( (csf2->SubClassSet) = _hb_alloc( (count)*sizeof(HB_SubClassSet), &error ), error != 0 )
0
1525 goto Fail2;
never executed: goto Fail2;
0
1526 -
1527 scs = csf2->SubClassSet; -
1528 -
1529 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1530 { -
1531 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
1532 goto Fail1;
never executed: goto Fail1;
0
1533 -
1534 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
1535 -
1536 _hb_stream_frame_exit( stream ); -
1537 -
1538 if ( new_offset != base_offset )
never evaluated: new_offset != base_offset
0
1539 { -
1540 cur_offset = _hb_stream_pos( stream ); -
1541 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
1542 ( error = Load_SubClassSet( csf2, &scs[n], 0
1543 stream ) ) != HB_Err_Ok )
never evaluated: ( error = Load_SubClassSet( csf2, &scs[n], stream ) ) != HB_Err_Ok
0
1544 goto Fail1;
never executed: goto Fail1;
0
1545 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
1546 }
never executed: }
0
1547 else -
1548 { -
1549 -
1550 -
1551 csf2->SubClassSet[n].SubClassRuleCount = 0; -
1552 csf2->SubClassSet[n].SubClassRule = ((void *)0); -
1553 }
never executed: }
0
1554 } -
1555 -
1556 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1557 -
1558Fail1: -
1559 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
1560 Free_SubClassSet( &scs[m] );
never executed: Free_SubClassSet( &scs[m] );
0
1561 -
1562 do { if ( (scs) ) { _hb_free( scs ); scs = ((void *)0); } } while (0);
never evaluated: (scs)
never evaluated: 0
never executed: }
never executed: }
0
1563 -
1564Fail2:
code before this statement never executed: Fail2:
0
1565 _HB_OPEN_Free_ClassDefinition( &csf2->ClassDef ); -
1566 -
1567Fail3:
code before this statement never executed: Fail3:
0
1568 _HB_OPEN_Free_Coverage( &csf2->Coverage ); -
1569 return error;
never executed: return error;
0
1570} -
1571 -
1572 -
1573static void Free_ContextSubst2( HB_ContextSubstFormat2* csf2 ) -
1574{ -
1575 HB_UShort n, count; -
1576 -
1577 HB_SubClassSet* scs; -
1578 -
1579 -
1580 if ( csf2->SubClassSet )
never evaluated: csf2->SubClassSet
0
1581 { -
1582 count = csf2->SubClassSetCount; -
1583 scs = csf2->SubClassSet; -
1584 -
1585 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1586 Free_SubClassSet( &scs[n] );
never executed: Free_SubClassSet( &scs[n] );
0
1587 -
1588 do { if ( (scs) ) { _hb_free( scs ); scs = ((void *)0); } } while (0);
never evaluated: (scs)
never evaluated: 0
never executed: }
never executed: }
0
1589 }
never executed: }
0
1590 -
1591 _HB_OPEN_Free_ClassDefinition( &csf2->ClassDef ); -
1592 _HB_OPEN_Free_Coverage( &csf2->Coverage ); -
1593}
never executed: }
0
1594 -
1595 -
1596 -
1597 -
1598static HB_Error Load_ContextSubst3( HB_ContextSubstFormat3* csf3, -
1599 HB_Stream stream ) -
1600{ -
1601 HB_Error error; -
1602 -
1603 HB_UShort n = 0, m, count; -
1604 HB_UInt cur_offset, new_offset, base_offset; -
1605 -
1606 HB_Coverage* c; -
1607 HB_SubstLookupRecord* slr; -
1608 -
1609 -
1610 base_offset = _hb_stream_pos( stream ) - 2L; -
1611 -
1612 if ( ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
0
1613 return error;
never executed: return error;
0
1614 -
1615 csf3->GlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1616 csf3->SubstCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1617 -
1618 _hb_stream_frame_exit( stream ); -
1619 -
1620 csf3->Coverage = ((void *)0); -
1621 -
1622 count = csf3->GlyphCount; -
1623 -
1624 if ( ( (csf3->Coverage) = _hb_alloc( (count)*sizeof(HB_Coverage), &error ), error != 0 ) )
never evaluated: ( (csf3->Coverage) = _hb_alloc( (count)*sizeof(HB_Coverage), &error ), error != 0 )
0
1625 return error;
never executed: return error;
0
1626 -
1627 c = csf3->Coverage; -
1628 -
1629 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1630 { -
1631 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
1632 goto Fail2;
never executed: goto Fail2;
0
1633 -
1634 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
1635 -
1636 _hb_stream_frame_exit( stream ); -
1637 -
1638 cur_offset = _hb_stream_pos( stream ); -
1639 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
1640 ( 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
1641 goto Fail2;
never executed: goto Fail2;
0
1642 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
1643 }
never executed: }
0
1644 -
1645 csf3->SubstLookupRecord = ((void *)0); -
1646 -
1647 count = csf3->SubstCount; -
1648 -
1649 if ( ( (csf3->SubstLookupRecord) = _hb_alloc( (count)*sizeof(HB_SubstLookupRecord), &error ), error != 0 ) )
never evaluated: ( (csf3->SubstLookupRecord) = _hb_alloc( (count)*sizeof(HB_SubstLookupRecord), &error ), error != 0 )
0
1650 -
1651 goto Fail2;
never executed: goto Fail2;
0
1652 -
1653 slr = csf3->SubstLookupRecord; -
1654 -
1655 if ( ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 )
0
1656 goto Fail1;
never executed: goto Fail1;
0
1657 -
1658 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1659 { -
1660 slr[n].SequenceIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1661 slr[n].LookupListIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1662 }
never executed: }
0
1663 -
1664 _hb_stream_frame_exit( stream ); -
1665 -
1666 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1667 -
1668Fail1: -
1669 do { if ( (slr) ) { _hb_free( slr ); slr = ((void *)0); } } while (0);
never evaluated: (slr)
never evaluated: 0
never executed: }
never executed: }
0
1670 -
1671Fail2:
code before this statement never executed: Fail2:
0
1672 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
1673 _HB_OPEN_Free_Coverage( &c[m] );
never executed: _HB_OPEN_Free_Coverage( &c[m] );
0
1674 -
1675 do { if ( (c) ) { _hb_free( c ); c = ((void *)0); } } while (0);
never evaluated: (c)
never evaluated: 0
never executed: }
never executed: }
0
1676 return error;
never executed: return error;
0
1677} -
1678 -
1679 -
1680static void Free_ContextSubst3( HB_ContextSubstFormat3* csf3 ) -
1681{ -
1682 HB_UShort n, count; -
1683 -
1684 HB_Coverage* c; -
1685 -
1686 -
1687 do { if ( (csf3->SubstLookupRecord) ) { _hb_free( csf3->SubstLookupRecord ); csf3->SubstLookupRecord = ((void *)0); } } while (0);
never evaluated: (csf3->SubstLookupRecord)
never evaluated: 0
never executed: }
never executed: }
0
1688 -
1689 if ( csf3->Coverage )
never evaluated: csf3->Coverage
0
1690 { -
1691 count = csf3->GlyphCount; -
1692 c = csf3->Coverage; -
1693 -
1694 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1695 _HB_OPEN_Free_Coverage( &c[n] );
never executed: _HB_OPEN_Free_Coverage( &c[n] );
0
1696 -
1697 do { if ( (c) ) { _hb_free( c ); c = ((void *)0); } } while (0);
never evaluated: (c)
never evaluated: 0
never executed: }
never executed: }
0
1698 }
never executed: }
0
1699}
never executed: }
0
1700 -
1701 -
1702 -
1703 -
1704static HB_Error Load_ContextSubst( HB_GSUB_SubTable* st, -
1705 HB_Stream stream ) -
1706{ -
1707 HB_Error error; -
1708 HB_ContextSubst* cs = &st->context; -
1709 -
1710 -
1711 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
1712 return error;
never executed: return error;
0
1713 -
1714 cs->SubstFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1715 -
1716 _hb_stream_frame_exit( stream ); -
1717 -
1718 switch ( cs->SubstFormat ) -
1719 { -
1720 case 1: return Load_ContextSubst1( &cs->csf.csf1, stream );
never executed: return Load_ContextSubst1( &cs->csf.csf1, stream );
0
1721 case 2: return Load_ContextSubst2( &cs->csf.csf2, stream );
never executed: return Load_ContextSubst2( &cs->csf.csf2, stream );
0
1722 case 3: return Load_ContextSubst3( &cs->csf.csf3, stream );
never executed: return Load_ContextSubst3( &cs->csf.csf3, stream );
0
1723 default: return _hb_err (HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
1724 } -
1725 -
1726 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1727} -
1728 -
1729 -
1730static void Free_ContextSubst( HB_GSUB_SubTable* st ) -
1731{ -
1732 HB_ContextSubst* cs = &st->context; -
1733 -
1734 switch ( cs->SubstFormat ) -
1735 { -
1736 case 1: Free_ContextSubst1( &cs->csf.csf1 ); break;
never executed: break;
0
1737 case 2: Free_ContextSubst2( &cs->csf.csf2 ); break;
never executed: break;
0
1738 case 3: Free_ContextSubst3( &cs->csf.csf3 ); break;
never executed: break;
0
1739 default: break;
never executed: break;
0
1740 } -
1741}
never executed: }
0
1742 -
1743 -
1744static HB_Error Lookup_ContextSubst1( HB_GSUBHeader* gsub, -
1745 HB_ContextSubstFormat1* csf1, -
1746 HB_Buffer buffer, -
1747 HB_UShort flags, -
1748 HB_UShort context_length, -
1749 int nesting_level ) -
1750{ -
1751 HB_UShort index, property; -
1752 HB_UShort i, j, k, numsr; -
1753 HB_Error error; -
1754 -
1755 HB_SubRule* sr; -
1756 HB_GDEFHeader* gdef; -
1757 -
1758 -
1759 gdef = gsub->gdef; -
1760 -
1761 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
1762 return error;
never executed: return error;
0
1763 -
1764 error = _HB_OPEN_Coverage_Index( &csf1->Coverage, (buffer->in_string[buffer->in_pos].gindex), &index ); -
1765 if ( error )
never evaluated: error
0
1766 return error;
never executed: return error;
0
1767 -
1768 sr = csf1->SubRuleSet[index].SubRule; -
1769 numsr = csf1->SubRuleSet[index].SubRuleCount; -
1770 -
1771 for ( k = 0; k < numsr; k++ )
never evaluated: k < numsr
0
1772 { -
1773 if ( context_length != 0xFFFF && context_length < sr[k].GlyphCount )
never evaluated: context_length != 0xFFFF
never evaluated: context_length < sr[k].GlyphCount
0
1774 goto next_subrule;
never executed: goto next_subrule;
0
1775 -
1776 if ( buffer->in_pos + sr[k].GlyphCount > buffer->in_length )
never evaluated: buffer->in_pos + sr[k].GlyphCount > buffer->in_length
0
1777 goto next_subrule;
never executed: goto next_subrule;
0
1778 -
1779 for ( i = 1, j = buffer->in_pos + 1; i < sr[k].GlyphCount; i++, j++ )
never evaluated: i < sr[k].GlyphCount
0
1780 { -
1781 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
1782 { -
1783 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
1784 return error;
never executed: return error;
0
1785 -
1786 if ( j + sr[k].GlyphCount - i == (HB_Int)buffer->in_length )
never evaluated: j + sr[k].GlyphCount - i == (HB_Int)buffer->in_length
0
1787 goto next_subrule;
never executed: goto next_subrule;
0
1788 j++; -
1789 }
never executed: }
0
1790 -
1791 if ( (buffer->in_string[(j)].gindex) != sr[k].Input[i - 1] )
never evaluated: (buffer->in_string[(j)].gindex) != sr[k].Input[i - 1]
0
1792 goto next_subrule;
never executed: goto next_subrule;
0
1793 }
never executed: }
0
1794 -
1795 return Do_ContextSubst( gsub, sr[k].GlyphCount, 0
1796 sr[k].SubstCount, sr[k].SubstLookupRecord, 0
1797 buffer, 0
1798 nesting_level );
never executed: return Do_ContextSubst( gsub, sr[k].GlyphCount, sr[k].SubstCount, sr[k].SubstLookupRecord, buffer, nesting_level );
0
1799 next_subrule: -
1800 ; -
1801 }
never executed: }
0
1802 -
1803 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
1804} -
1805 -
1806 -
1807static HB_Error Lookup_ContextSubst2( HB_GSUBHeader* gsub, -
1808 HB_ContextSubstFormat2* csf2, -
1809 HB_Buffer buffer, -
1810 HB_UShort flags, -
1811 HB_UShort context_length, -
1812 int nesting_level ) -
1813{ -
1814 HB_UShort index, property; -
1815 HB_Error error; -
1816 HB_UShort i, j, k, known_classes; -
1817 -
1818 HB_UShort* classes; -
1819 HB_UShort* cl; -
1820 -
1821 HB_SubClassSet* scs; -
1822 HB_SubClassRule* sr; -
1823 HB_GDEFHeader* gdef; -
1824 -
1825 -
1826 gdef = gsub->gdef; -
1827 -
1828 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
1829 return error;
never executed: return error;
0
1830 -
1831 -
1832 -
1833 -
1834 -
1835 error = _HB_OPEN_Coverage_Index( &csf2->Coverage, (buffer->in_string[buffer->in_pos].gindex), &index ); -
1836 if ( error )
never evaluated: error
0
1837 return error;
never executed: return error;
0
1838 -
1839 if (csf2->MaxContextLength < 1)
never evaluated: csf2->MaxContextLength < 1
0
1840 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
1841 -
1842 if ( ( (classes) = _hb_alloc( (csf2->MaxContextLength)*sizeof(HB_UShort), &error ), error != 0 ) )
never evaluated: ( (classes) = _hb_alloc( (csf2->MaxContextLength)*sizeof(HB_UShort), &error ), error != 0 )
0
1843 return error;
never executed: return error;
0
1844 -
1845 error = _HB_OPEN_Get_Class( &csf2->ClassDef, (buffer->in_string[buffer->in_pos].gindex), -
1846 &classes[0], ((void *)0) ); -
1847 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
1848 goto End;
never executed: goto End;
0
1849 known_classes = 0; -
1850 -
1851 scs = &csf2->SubClassSet[classes[0]]; -
1852 if ( !scs )
never evaluated: !scs
0
1853 { -
1854 error = _hb_err (HB_Err_Invalid_SubTable); -
1855 goto End;
never executed: goto End;
0
1856 } -
1857 -
1858 for ( k = 0; k < scs->SubClassRuleCount; k++ )
never evaluated: k < scs->SubClassRuleCount
0
1859 { -
1860 sr = &scs->SubClassRule[k]; -
1861 -
1862 if ( context_length != 0xFFFF && context_length < sr->GlyphCount )
never evaluated: context_length != 0xFFFF
never evaluated: context_length < sr->GlyphCount
0
1863 goto next_subclassrule;
never executed: goto next_subclassrule;
0
1864 -
1865 if ( buffer->in_pos + sr->GlyphCount > buffer->in_length )
never evaluated: buffer->in_pos + sr->GlyphCount > buffer->in_length
0
1866 goto next_subclassrule;
never executed: goto next_subclassrule;
0
1867 -
1868 cl = sr->Class; -
1869 -
1870 -
1871 -
1872 for ( i = 1, j = buffer->in_pos + 1; i < sr->GlyphCount; i++, j++ )
never evaluated: i < sr->GlyphCount
0
1873 { -
1874 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
1875 { -
1876 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
1877 goto End;
never executed: goto End;
0
1878 -
1879 if ( j + sr->GlyphCount - i < (HB_Int)buffer->in_length )
never evaluated: j + sr->GlyphCount - i < (HB_Int)buffer->in_length
0
1880 goto next_subclassrule;
never executed: goto next_subclassrule;
0
1881 j++; -
1882 }
never executed: }
0
1883 -
1884 if ( i > known_classes )
never evaluated: i > known_classes
0
1885 { -
1886 -
1887 -
1888 error = _HB_OPEN_Get_Class( &csf2->ClassDef, (buffer->in_string[(j)].gindex), &classes[i], ((void *)0) ); -
1889 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
1890 goto End;
never executed: goto End;
0
1891 known_classes = i; -
1892 }
never executed: }
0
1893 -
1894 if ( cl[i - 1] != classes[i] )
never evaluated: cl[i - 1] != classes[i]
0
1895 goto next_subclassrule;
never executed: goto next_subclassrule;
0
1896 }
never executed: }
0
1897 -
1898 error = Do_ContextSubst( gsub, sr->GlyphCount, -
1899 sr->SubstCount, sr->SubstLookupRecord, -
1900 buffer, -
1901 nesting_level ); -
1902 goto End;
never executed: goto End;
0
1903 -
1904 next_subclassrule: -
1905 ; -
1906 }
never executed: }
0
1907 -
1908 error = HB_Err_Not_Covered; -
1909 -
1910End:
code before this statement never executed: End:
0
1911 do { if ( (classes) ) { _hb_free( classes ); classes = ((void *)0); } } while (0);
never evaluated: (classes)
never evaluated: 0
never executed: }
never executed: }
0
1912 return error;
never executed: return error;
0
1913} -
1914 -
1915 -
1916static HB_Error Lookup_ContextSubst3( HB_GSUBHeader* gsub, -
1917 HB_ContextSubstFormat3* csf3, -
1918 HB_Buffer buffer, -
1919 HB_UShort flags, -
1920 HB_UShort context_length, -
1921 int nesting_level ) -
1922{ -
1923 HB_Error error; -
1924 HB_UShort index, i, j, property; -
1925 -
1926 HB_Coverage* c; -
1927 HB_GDEFHeader* gdef; -
1928 -
1929 -
1930 gdef = gsub->gdef; -
1931 -
1932 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
1933 return error;
never executed: return error;
0
1934 -
1935 if ( context_length != 0xFFFF && context_length < csf3->GlyphCount )
never evaluated: context_length != 0xFFFF
never evaluated: context_length < csf3->GlyphCount
0
1936 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
1937 -
1938 if ( buffer->in_pos + csf3->GlyphCount > buffer->in_length )
never evaluated: buffer->in_pos + csf3->GlyphCount > buffer->in_length
0
1939 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
1940 -
1941 c = csf3->Coverage; -
1942 -
1943 for ( i = 1, j = buffer->in_pos + 1; i < csf3->GlyphCount; i++, j++ )
never evaluated: i < csf3->GlyphCount
0
1944 { -
1945 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
1946 { -
1947 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
1948 return error;
never executed: return error;
0
1949 -
1950 if ( j + csf3->GlyphCount - i == (HB_Int)buffer->in_length )
never evaluated: j + csf3->GlyphCount - i == (HB_Int)buffer->in_length
0
1951 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
1952 j++; -
1953 }
never executed: }
0
1954 -
1955 error = _HB_OPEN_Coverage_Index( &c[i], (buffer->in_string[(j)].gindex), &index ); -
1956 if ( error )
never evaluated: error
0
1957 return error;
never executed: return error;
0
1958 }
never executed: }
0
1959 -
1960 return Do_ContextSubst( gsub, csf3->GlyphCount, 0
1961 csf3->SubstCount, csf3->SubstLookupRecord, 0
1962 buffer, 0
1963 nesting_level );
never executed: return Do_ContextSubst( gsub, csf3->GlyphCount, csf3->SubstCount, csf3->SubstLookupRecord, buffer, nesting_level );
0
1964} -
1965 -
1966 -
1967static HB_Error Lookup_ContextSubst( HB_GSUBHeader* gsub, -
1968 HB_GSUB_SubTable* st, -
1969 HB_Buffer buffer, -
1970 HB_UShort flags, -
1971 HB_UShort context_length, -
1972 int nesting_level ) -
1973{ -
1974 HB_ContextSubst* cs = &st->context; -
1975 -
1976 switch ( cs->SubstFormat ) -
1977 { -
1978 case 1: return Lookup_ContextSubst1( gsub, &cs->csf.csf1, buffer, flags, context_length, nesting_level );
never executed: return Lookup_ContextSubst1( gsub, &cs->csf.csf1, buffer, flags, context_length, nesting_level );
0
1979 case 2: return Lookup_ContextSubst2( gsub, &cs->csf.csf2, buffer, flags, context_length, nesting_level );
never executed: return Lookup_ContextSubst2( gsub, &cs->csf.csf2, buffer, flags, context_length, nesting_level );
0
1980 case 3: return Lookup_ContextSubst3( gsub, &cs->csf.csf3, buffer, flags, context_length, nesting_level );
never executed: return Lookup_ContextSubst3( gsub, &cs->csf.csf3, buffer, flags, context_length, nesting_level );
0
1981 default: return _hb_err (HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
1982 } -
1983 -
1984 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1985} -
1986 -
1987 -
1988 -
1989 -
1990 -
1991 -
1992static HB_Error Load_ChainSubRule( HB_ChainSubRule* csr, -
1993 HB_Stream stream ) -
1994{ -
1995 HB_Error error; -
1996 -
1997 HB_UShort n, count; -
1998 HB_UShort* b; -
1999 HB_UShort* i; -
2000 HB_UShort* l; -
2001 -
2002 HB_SubstLookupRecord* slr; -
2003 -
2004 -
2005 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2006 return error;
never executed: return error;
0
2007 -
2008 csr->BacktrackGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2009 -
2010 _hb_stream_frame_exit( stream ); -
2011 -
2012 csr->Backtrack = ((void *)0); -
2013 -
2014 count = csr->BacktrackGlyphCount; -
2015 -
2016 if ( ( (csr->Backtrack) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
never evaluated: ( (csr->Backtrack) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
0
2017 return error;
never executed: return error;
0
2018 -
2019 b = csr->Backtrack; -
2020 -
2021 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
0
2022 goto Fail4;
never executed: goto Fail4;
0
2023 -
2024 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
2025 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
2026 -
2027 _hb_stream_frame_exit( stream ); -
2028 -
2029 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2030 goto Fail4;
never executed: goto Fail4;
0
2031 -
2032 csr->InputGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2033 -
2034 _hb_stream_frame_exit( stream ); -
2035 -
2036 csr->Input = ((void *)0); -
2037 -
2038 count = csr->InputGlyphCount - 1; -
2039 -
2040 if ( ( (csr->Input) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
never evaluated: ( (csr->Input) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
0
2041 goto Fail4;
never executed: goto Fail4;
0
2042 -
2043 i = csr->Input; -
2044 -
2045 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
0
2046 goto Fail3;
never executed: goto Fail3;
0
2047 -
2048 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
2049 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
2050 -
2051 _hb_stream_frame_exit( stream ); -
2052 -
2053 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2054 goto Fail3;
never executed: goto Fail3;
0
2055 -
2056 csr->LookaheadGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2057 -
2058 _hb_stream_frame_exit( stream ); -
2059 -
2060 csr->Lookahead = ((void *)0); -
2061 -
2062 count = csr->LookaheadGlyphCount; -
2063 -
2064 if ( ( (csr->Lookahead) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
never evaluated: ( (csr->Lookahead) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
0
2065 goto Fail3;
never executed: goto Fail3;
0
2066 -
2067 l = csr->Lookahead; -
2068 -
2069 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
0
2070 goto Fail2;
never executed: goto Fail2;
0
2071 -
2072 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
2073 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
2074 -
2075 _hb_stream_frame_exit( stream ); -
2076 -
2077 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2078 goto Fail2;
never executed: goto Fail2;
0
2079 -
2080 csr->SubstCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2081 -
2082 _hb_stream_frame_exit( stream ); -
2083 -
2084 csr->SubstLookupRecord = ((void *)0); -
2085 -
2086 count = csr->SubstCount; -
2087 -
2088 if ( ( (csr->SubstLookupRecord) = _hb_alloc( (count)*sizeof(HB_SubstLookupRecord), &error ), error != 0 ) )
never evaluated: ( (csr->SubstLookupRecord) = _hb_alloc( (count)*sizeof(HB_SubstLookupRecord), &error ), error != 0 )
0
2089 goto Fail2;
never executed: goto Fail2;
0
2090 -
2091 slr = csr->SubstLookupRecord; -
2092 -
2093 if ( ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 )
0
2094 goto Fail1;
never executed: goto Fail1;
0
2095 -
2096 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
2097 { -
2098 slr[n].SequenceIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2099 slr[n].LookupListIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2100 }
never executed: }
0
2101 -
2102 _hb_stream_frame_exit( stream ); -
2103 -
2104 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
2105 -
2106Fail1: -
2107 do { if ( (slr) ) { _hb_free( slr ); slr = ((void *)0); } } while (0);
never evaluated: (slr)
never evaluated: 0
never executed: }
never executed: }
0
2108 -
2109Fail2:
code before this statement never executed: Fail2:
0
2110 do { if ( (l) ) { _hb_free( l ); l = ((void *)0); } } while (0);
never evaluated: (l)
never evaluated: 0
never executed: }
never executed: }
0
2111 -
2112Fail3:
code before this statement never executed: Fail3:
0
2113 do { if ( (i) ) { _hb_free( i ); i = ((void *)0); } } while (0);
never evaluated: (i)
never evaluated: 0
never executed: }
never executed: }
0
2114 -
2115Fail4:
code before this statement never executed: Fail4:
0
2116 do { if ( (b) ) { _hb_free( b ); b = ((void *)0); } } while (0);
never evaluated: (b)
never evaluated: 0
never executed: }
never executed: }
0
2117 return error;
never executed: return error;
0
2118} -
2119 -
2120 -
2121static void Free_ChainSubRule( HB_ChainSubRule* csr ) -
2122{ -
2123 do { if ( (csr->SubstLookupRecord) ) { _hb_free( csr->SubstLookupRecord ); csr->SubstLookupRecord = ((void *)0); } } while (0);
never evaluated: (csr->SubstLookupRecord)
never evaluated: 0
never executed: }
never executed: }
0
2124 do { if ( (csr->Lookahead) ) { _hb_free( csr->Lookahead ); csr->Lookahead = ((void *)0); } } while (0);
never evaluated: (csr->Lookahead)
never evaluated: 0
never executed: }
never executed: }
0
2125 do { if ( (csr->Input) ) { _hb_free( csr->Input ); csr->Input = ((void *)0); } } while (0);
never evaluated: (csr->Input)
never evaluated: 0
never executed: }
never executed: }
0
2126 do { if ( (csr->Backtrack) ) { _hb_free( csr->Backtrack ); csr->Backtrack = ((void *)0); } } while (0);
never evaluated: (csr->Backtrack)
never evaluated: 0
never executed: }
never executed: }
0
2127}
never executed: }
0
2128 -
2129 -
2130 -
2131 -
2132static HB_Error Load_ChainSubRuleSet( HB_ChainSubRuleSet* csrs, -
2133 HB_Stream stream ) -
2134{ -
2135 HB_Error error; -
2136 -
2137 HB_UShort n = 0, m, count; -
2138 HB_UInt cur_offset, new_offset, base_offset; -
2139 -
2140 HB_ChainSubRule* csr; -
2141 -
2142 -
2143 base_offset = _hb_stream_pos( stream ); -
2144 -
2145 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2146 return error;
never executed: return error;
0
2147 -
2148 count = csrs->ChainSubRuleCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2149 -
2150 _hb_stream_frame_exit( stream ); -
2151 -
2152 csrs->ChainSubRule = ((void *)0); -
2153 -
2154 if ( ( (csrs->ChainSubRule) = _hb_alloc( (count)*sizeof(HB_ChainSubRule), &error ), error != 0 ) )
never evaluated: ( (csrs->ChainSubRule) = _hb_alloc( (count)*sizeof(HB_ChainSubRule), &error ), error != 0 )
0
2155 return error;
never executed: return error;
0
2156 -
2157 csr = csrs->ChainSubRule; -
2158 -
2159 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
2160 { -
2161 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2162 goto Fail;
never executed: goto Fail;
0
2163 -
2164 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
2165 -
2166 _hb_stream_frame_exit( stream ); -
2167 -
2168 cur_offset = _hb_stream_pos( stream ); -
2169 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
2170 ( error = Load_ChainSubRule( &csr[n], stream ) ) != HB_Err_Ok )
never evaluated: ( error = Load_ChainSubRule( &csr[n], stream ) ) != HB_Err_Ok
0
2171 goto Fail;
never executed: goto Fail;
0
2172 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
2173 }
never executed: }
0
2174 -
2175 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
2176 -
2177Fail: -
2178 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
2179 Free_ChainSubRule( &csr[m] );
never executed: Free_ChainSubRule( &csr[m] );
0
2180 -
2181 do { if ( (csr) ) { _hb_free( csr ); csr = ((void *)0); } } while (0);
never evaluated: (csr)
never evaluated: 0
never executed: }
never executed: }
0
2182 return error;
never executed: return error;
0
2183} -
2184 -
2185 -
2186static void Free_ChainSubRuleSet( HB_ChainSubRuleSet* csrs ) -
2187{ -
2188 HB_UShort n, count; -
2189 -
2190 HB_ChainSubRule* csr; -
2191 -
2192 -
2193 if ( csrs->ChainSubRule )
never evaluated: csrs->ChainSubRule
0
2194 { -
2195 count = csrs->ChainSubRuleCount; -
2196 csr = csrs->ChainSubRule; -
2197 -
2198 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
2199 Free_ChainSubRule( &csr[n] );
never executed: Free_ChainSubRule( &csr[n] );
0
2200 -
2201 do { if ( (csr) ) { _hb_free( csr ); csr = ((void *)0); } } while (0);
never evaluated: (csr)
never evaluated: 0
never executed: }
never executed: }
0
2202 }
never executed: }
0
2203}
never executed: }
0
2204 -
2205 -
2206 -
2207 -
2208static HB_Error Load_ChainContextSubst1( -
2209 HB_ChainContextSubstFormat1* ccsf1, -
2210 HB_Stream stream ) -
2211{ -
2212 HB_Error error; -
2213 -
2214 HB_UShort n = 0, m, count; -
2215 HB_UInt cur_offset, new_offset, base_offset; -
2216 -
2217 HB_ChainSubRuleSet* csrs; -
2218 -
2219 -
2220 base_offset = _hb_stream_pos( stream ) - 2L; -
2221 -
2222 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2223 return error;
never executed: return error;
0
2224 -
2225 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
2226 -
2227 _hb_stream_frame_exit( stream ); -
2228 -
2229 cur_offset = _hb_stream_pos( stream ); -
2230 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
2231 ( error = _HB_OPEN_Load_Coverage( &ccsf1->Coverage, stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Coverage( &ccsf1->Coverage, stream ) ) != HB_Err_Ok
0
2232 return error;
never executed: return error;
0
2233 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
2234 -
2235 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2236 goto Fail2;
never executed: goto Fail2;
0
2237 -
2238 count = ccsf1->ChainSubRuleSetCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2239 -
2240 _hb_stream_frame_exit( stream ); -
2241 -
2242 ccsf1->ChainSubRuleSet = ((void *)0); -
2243 -
2244 if ( ( (ccsf1->ChainSubRuleSet) = _hb_alloc( (count)*sizeof(HB_ChainSubRuleSet), &error ), error != 0 ) )
never evaluated: ( (ccsf1->ChainSubRuleSet) = _hb_alloc( (count)*sizeof(HB_ChainSubRuleSet), &error ), error != 0 )
0
2245 goto Fail2;
never executed: goto Fail2;
0
2246 -
2247 csrs = ccsf1->ChainSubRuleSet; -
2248 -
2249 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
2250 { -
2251 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2252 goto Fail1;
never executed: goto Fail1;
0
2253 -
2254 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
2255 -
2256 _hb_stream_frame_exit( stream ); -
2257 -
2258 cur_offset = _hb_stream_pos( stream ); -
2259 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
2260 ( error = Load_ChainSubRuleSet( &csrs[n], stream ) ) != HB_Err_Ok )
never evaluated: ( error = Load_ChainSubRuleSet( &csrs[n], stream ) ) != HB_Err_Ok
0
2261 goto Fail1;
never executed: goto Fail1;
0
2262 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
2263 }
never executed: }
0
2264 -
2265 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
2266 -
2267Fail1: -
2268 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
2269 Free_ChainSubRuleSet( &csrs[m] );
never executed: Free_ChainSubRuleSet( &csrs[m] );
0
2270 -
2271 do { if ( (csrs) ) { _hb_free( csrs ); csrs = ((void *)0); } } while (0);
never evaluated: (csrs)
never evaluated: 0
never executed: }
never executed: }
0
2272 -
2273Fail2:
code before this statement never executed: Fail2:
0
2274 _HB_OPEN_Free_Coverage( &ccsf1->Coverage ); -
2275 return error;
never executed: return error;
0
2276} -
2277 -
2278 -
2279static void Free_ChainContextSubst1( HB_ChainContextSubstFormat1* ccsf1 ) -
2280{ -
2281 HB_UShort n, count; -
2282 -
2283 HB_ChainSubRuleSet* csrs; -
2284 -
2285 -
2286 if ( ccsf1->ChainSubRuleSet )
never evaluated: ccsf1->ChainSubRuleSet
0
2287 { -
2288 count = ccsf1->ChainSubRuleSetCount; -
2289 csrs = ccsf1->ChainSubRuleSet; -
2290 -
2291 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
2292 Free_ChainSubRuleSet( &csrs[n] );
never executed: Free_ChainSubRuleSet( &csrs[n] );
0
2293 -
2294 do { if ( (csrs) ) { _hb_free( csrs ); csrs = ((void *)0); } } while (0);
never evaluated: (csrs)
never evaluated: 0
never executed: }
never executed: }
0
2295 }
never executed: }
0
2296 -
2297 _HB_OPEN_Free_Coverage( &ccsf1->Coverage ); -
2298}
never executed: }
0
2299 -
2300 -
2301 -
2302 -
2303static HB_Error Load_ChainSubClassRule( -
2304 HB_ChainContextSubstFormat2* ccsf2, -
2305 HB_ChainSubClassRule* cscr, -
2306 HB_Stream stream ) -
2307{ -
2308 HB_Error error; -
2309 -
2310 HB_UShort n, count; -
2311 -
2312 HB_UShort* b; -
2313 HB_UShort* i; -
2314 HB_UShort* l; -
2315 HB_SubstLookupRecord* slr; -
2316 -
2317 -
2318 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:2709
0-2709
2319 return error;
never executed: return error;
0
2320 -
2321 cscr->BacktrackGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2322 -
2323 _hb_stream_frame_exit( stream ); -
2324 -
2325 if ( cscr->BacktrackGlyphCount > ccsf2->MaxBacktrackLength )
evaluated: cscr->BacktrackGlyphCount > ccsf2->MaxBacktrackLength
TRUEFALSE
yes
Evaluation Count:981
yes
Evaluation Count:1728
981-1728
2326 ccsf2->MaxBacktrackLength = cscr->BacktrackGlyphCount;
executed: ccsf2->MaxBacktrackLength = cscr->BacktrackGlyphCount;
Execution Count:981
981
2327 -
2328 cscr->Backtrack = ((void *)0); -
2329 -
2330 count = cscr->BacktrackGlyphCount; -
2331 -
2332 if ( ( (cscr->Backtrack) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
partially evaluated: ( (cscr->Backtrack) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2333 return error;
never executed: return error;
0
2334 -
2335 b = cscr->Backtrack; -
2336 -
2337 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2338 goto Fail4;
never executed: goto Fail4;
0
2339 -
2340 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:1347
yes
Evaluation Count:2709
1347-2709
2341 b[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
executed: b[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
Execution Count:1347
1347
2342 -
2343 _hb_stream_frame_exit( stream ); -
2344 -
2345 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:2709
0-2709
2346 goto Fail4;
never executed: goto Fail4;
0
2347 -
2348 cscr->InputGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2349 -
2350 _hb_stream_frame_exit( stream ); -
2351 -
2352 if ( cscr->InputGlyphCount > ccsf2->MaxInputLength )
evaluated: cscr->InputGlyphCount > ccsf2->MaxInputLength
TRUEFALSE
yes
Evaluation Count:1475
yes
Evaluation Count:1234
1234-1475
2353 ccsf2->MaxInputLength = cscr->InputGlyphCount;
executed: ccsf2->MaxInputLength = cscr->InputGlyphCount;
Execution Count:1475
1475
2354 -
2355 cscr->Input = ((void *)0); -
2356 -
2357 count = cscr->InputGlyphCount - 1; -
2358 -
2359 if ( ( (cscr->Input) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
partially evaluated: ( (cscr->Input) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2360 goto Fail4;
never executed: goto Fail4;
0
2361 -
2362 i = cscr->Input; -
2363 -
2364 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2365 goto Fail3;
never executed: goto Fail3;
0
2366 -
2367 for ( n = 0; n < count; n++ )
partially evaluated: n < count
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2368 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
2369 -
2370 _hb_stream_frame_exit( stream ); -
2371 -
2372 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:2709
0-2709
2373 goto Fail3;
never executed: goto Fail3;
0
2374 -
2375 cscr->LookaheadGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2376 -
2377 _hb_stream_frame_exit( stream ); -
2378 -
2379 if ( cscr->LookaheadGlyphCount > ccsf2->MaxLookaheadLength )
evaluated: cscr->LookaheadGlyphCount > ccsf2->MaxLookaheadLength
TRUEFALSE
yes
Evaluation Count:1118
yes
Evaluation Count:1591
1118-1591
2380 ccsf2->MaxLookaheadLength = cscr->LookaheadGlyphCount;
executed: ccsf2->MaxLookaheadLength = cscr->LookaheadGlyphCount;
Execution Count:1118
1118
2381 -
2382 cscr->Lookahead = ((void *)0); -
2383 -
2384 count = cscr->LookaheadGlyphCount; -
2385 -
2386 if ( ( (cscr->Lookahead) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
partially evaluated: ( (cscr->Lookahead) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2387 goto Fail3;
never executed: goto Fail3;
0
2388 -
2389 l = cscr->Lookahead; -
2390 -
2391 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2392 goto Fail2;
never executed: goto Fail2;
0
2393 -
2394 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:2112
yes
Evaluation Count:2709
2112-2709
2395 l[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
executed: l[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
Execution Count:2112
2112
2396 -
2397 _hb_stream_frame_exit( stream ); -
2398 -
2399 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:2709
0-2709
2400 goto Fail2;
never executed: goto Fail2;
0
2401 -
2402 cscr->SubstCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2403 -
2404 _hb_stream_frame_exit( stream ); -
2405 -
2406 cscr->SubstLookupRecord = ((void *)0); -
2407 -
2408 count = cscr->SubstCount; -
2409 -
2410 if ( ( (cscr->SubstLookupRecord) = _hb_alloc( (count)*sizeof(HB_SubstLookupRecord), &error ), error != 0 ) )
partially evaluated: ( (cscr->SubstLookupRecord) = _hb_alloc( (count)*sizeof(HB_SubstLookupRecord), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2411 -
2412 goto Fail2;
never executed: goto Fail2;
0
2413 -
2414 slr = cscr->SubstLookupRecord; -
2415 -
2416 if ( ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2417 goto Fail1;
never executed: goto Fail1;
0
2418 -
2419 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:2709
yes
Evaluation Count:2709
2709
2420 { -
2421 slr[n].SequenceIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2422 slr[n].LookupListIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2423 }
executed: }
Execution Count:2709
2709
2424 -
2425 _hb_stream_frame_exit( stream ); -
2426 -
2427 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:2709
2709
2428 -
2429Fail1: -
2430 do { if ( (slr) ) { _hb_free( slr ); slr = ((void *)0); } } while (0);
never evaluated: (slr)
never evaluated: 0
never executed: }
never executed: }
0
2431 -
2432Fail2:
code before this statement never executed: Fail2:
0
2433 do { if ( (l) ) { _hb_free( l ); l = ((void *)0); } } while (0);
never evaluated: (l)
never evaluated: 0
never executed: }
never executed: }
0
2434 -
2435Fail3:
code before this statement never executed: Fail3:
0
2436 do { if ( (i) ) { _hb_free( i ); i = ((void *)0); } } while (0);
never evaluated: (i)
never evaluated: 0
never executed: }
never executed: }
0
2437 -
2438Fail4:
code before this statement never executed: Fail4:
0
2439 do { if ( (b) ) { _hb_free( b ); b = ((void *)0); } } while (0);
never evaluated: (b)
never evaluated: 0
never executed: }
never executed: }
0
2440 return error;
never executed: return error;
0
2441} -
2442 -
2443 -
2444static void Free_ChainSubClassRule( HB_ChainSubClassRule* cscr ) -
2445{ -
2446 do { if ( (cscr->SubstLookupRecord) ) { _hb_free( cscr->SubstLookupRecord ); cscr->SubstLookupRecord = ((void *)0); } } while (0);
partially evaluated: (cscr->SubstLookupRecord)
TRUEFALSE
yes
Evaluation Count:2574
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2574
executed: }
Execution Count:2574
executed: }
Execution Count:2574
0-2574
2447 do { if ( (cscr->Lookahead) ) { _hb_free( cscr->Lookahead ); cscr->Lookahead = ((void *)0); } } while (0);
evaluated: (cscr->Lookahead)
TRUEFALSE
yes
Evaluation Count:1641
yes
Evaluation Count:933
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2574
executed: }
Execution Count:1641
executed: }
Execution Count:2574
0-2574
2448 do { if ( (cscr->Input) ) { _hb_free( cscr->Input ); cscr->Input = ((void *)0); } } while (0);
partially evaluated: (cscr->Input)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2574
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2574
never executed: }
executed: }
Execution Count:2574
0-2574
2449 do { if ( (cscr->Backtrack) ) { _hb_free( cscr->Backtrack ); cscr->Backtrack = ((void *)0); } } while (0);
evaluated: (cscr->Backtrack)
TRUEFALSE
yes
Evaluation Count:933
yes
Evaluation Count:1641
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2574
executed: }
Execution Count:933
executed: }
Execution Count:2574
0-2574
2450}
executed: }
Execution Count:2574
2574
2451 -
2452 -
2453 -
2454 -
2455static HB_Error Load_ChainSubClassSet( -
2456 HB_ChainContextSubstFormat2* ccsf2, -
2457 HB_ChainSubClassSet* cscs, -
2458 HB_Stream stream ) -
2459{ -
2460 HB_Error error; -
2461 -
2462 HB_UShort n = 0, m, count; -
2463 HB_UInt cur_offset, new_offset, base_offset; -
2464 -
2465 HB_ChainSubClassRule* cscr; -
2466 -
2467 -
2468 base_offset = _hb_stream_pos( stream ); -
2469 -
2470 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:2209
0-2209
2471 return error;
never executed: return error;
0
2472 -
2473 count = cscs->ChainSubClassRuleCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2474 -
2475 _hb_stream_frame_exit( stream ); -
2476 -
2477 cscs->ChainSubClassRule = ((void *)0); -
2478 -
2479 if ( ( (cscs->ChainSubClassRule) = _hb_alloc( (count)*sizeof(HB_ChainSubClassRule), &error ), error != 0 ) )
partially evaluated: ( (cscs->ChainSubClassRule) = _hb_alloc( (count)*sizeof(HB_ChainSubClassRule), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2209
0-2209
2480 -
2481 return error;
never executed: return error;
0
2482 -
2483 cscr = cscs->ChainSubClassRule; -
2484 -
2485 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:2709
yes
Evaluation Count:2209
2209-2709
2486 { -
2487 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:2709
0-2709
2488 goto Fail;
never executed: goto Fail;
0
2489 -
2490 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
2491 -
2492 _hb_stream_frame_exit( stream ); -
2493 -
2494 cur_offset = _hb_stream_pos( stream ); -
2495 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:2709
0-2709
2496 ( error = Load_ChainSubClassRule( ccsf2, &cscr[n], 0-2709
2497 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_ChainSubClassRule( ccsf2, &cscr[n], stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2498 goto Fail;
never executed: goto Fail;
0
2499 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
2500 }
executed: }
Execution Count:2709
2709
2501 -
2502 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:2209
2209
2503 -
2504Fail: -
2505 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
2506 Free_ChainSubClassRule( &cscr[m] );
never executed: Free_ChainSubClassRule( &cscr[m] );
0
2507 -
2508 do { if ( (cscr) ) { _hb_free( cscr ); cscr = ((void *)0); } } while (0);
never evaluated: (cscr)
never evaluated: 0
never executed: }
never executed: }
0
2509 return error;
never executed: return error;
0
2510} -
2511 -
2512 -
2513static void Free_ChainSubClassSet( HB_ChainSubClassSet* cscs ) -
2514{ -
2515 HB_UShort n, count; -
2516 -
2517 HB_ChainSubClassRule* cscr; -
2518 -
2519 -
2520 if ( cscs->ChainSubClassRule )
evaluated: cscs->ChainSubClassRule
TRUEFALSE
yes
Evaluation Count:2100
yes
Evaluation Count:2339
2100-2339
2521 { -
2522 count = cscs->ChainSubClassRuleCount; -
2523 cscr = cscs->ChainSubClassRule; -
2524 -
2525 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:2574
yes
Evaluation Count:2100
2100-2574
2526 Free_ChainSubClassRule( &cscr[n] );
executed: Free_ChainSubClassRule( &cscr[n] );
Execution Count:2574
2574
2527 -
2528 do { if ( (cscr) ) { _hb_free( cscr ); cscr = ((void *)0); } } while (0);
partially evaluated: (cscr)
TRUEFALSE
yes
Evaluation Count:2100
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2100
executed: }
Execution Count:2100
executed: }
Execution Count:2100
0-2100
2529 }
executed: }
Execution Count:2100
2100
2530}
executed: }
Execution Count:4439
4439
2531 -
2532 -
2533 -
2534 -
2535static HB_Error Load_ChainContextSubst2( -
2536 HB_ChainContextSubstFormat2* ccsf2, -
2537 HB_Stream stream ) -
2538{ -
2539 HB_Error error; -
2540 -
2541 HB_UShort n = 0, m, count; -
2542 HB_UInt cur_offset, new_offset, base_offset; -
2543 HB_UInt backtrack_offset, input_offset, lookahead_offset; -
2544 -
2545 HB_ChainSubClassSet* cscs; -
2546 -
2547 -
2548 base_offset = _hb_stream_pos( stream ) - 2; -
2549 -
2550 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:1475
0-1475
2551 return error;
never executed: return error;
0
2552 -
2553 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
2554 -
2555 _hb_stream_frame_exit( stream ); -
2556 -
2557 cur_offset = _hb_stream_pos( stream ); -
2558 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:1475
0-1475
2559 ( error = _HB_OPEN_Load_Coverage( &ccsf2->Coverage, stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_Coverage( &ccsf2->Coverage, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1475
0-1475
2560 return error;
never executed: return error;
0
2561 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
2562 -
2563 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:1475
0-1475
2564 goto Fail5;
never executed: goto Fail5;
0
2565 -
2566 backtrack_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2567 input_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2568 lookahead_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2569 -
2570 -
2571 -
2572 -
2573 -
2574 count = ccsf2->ChainSubClassSetCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2575 -
2576 _hb_stream_frame_exit( stream ); -
2577 -
2578 if ( ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccsf2->BacktrackClassDef, 65535, 0-1475
2579 backtrack_offset, base_offset, 0-1475
2580 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccsf2->BacktrackClassDef, 65535, backtrack_offset, base_offset, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1475
0-1475
2581 goto Fail5;
never executed: goto Fail5;
0
2582 -
2583 if ( ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccsf2->InputClassDef, count, 0-1475
2584 input_offset, base_offset, 0-1475
2585 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccsf2->InputClassDef, count, input_offset, base_offset, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1475
0-1475
2586 goto Fail4;
never executed: goto Fail4;
0
2587 if ( ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccsf2->LookaheadClassDef, 65535, 0-1475
2588 lookahead_offset, base_offset, 0-1475
2589 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccsf2->LookaheadClassDef, 65535, lookahead_offset, base_offset, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1475
0-1475
2590 goto Fail3;
never executed: goto Fail3;
0
2591 -
2592 ccsf2->ChainSubClassSet = ((void *)0); -
2593 ccsf2->MaxBacktrackLength = 0; -
2594 ccsf2->MaxInputLength = 0; -
2595 ccsf2->MaxLookaheadLength = 0; -
2596 -
2597 if ( ( (ccsf2->ChainSubClassSet) = _hb_alloc( (count)*sizeof(HB_ChainSubClassSet), &error ), error != 0 ) )
partially evaluated: ( (ccsf2->ChainSubClassSet) = _hb_alloc( (count)*sizeof(HB_ChainSubClassSet), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1475
0-1475
2598 goto Fail2;
never executed: goto Fail2;
0
2599 -
2600 cscs = ccsf2->ChainSubClassSet; -
2601 -
2602 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:4671
yes
Evaluation Count:1475
1475-4671
2603 { -
2604 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:4671
0-4671
2605 goto Fail1;
never executed: goto Fail1;
0
2606 -
2607 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
2608 -
2609 _hb_stream_frame_exit( stream ); -
2610 -
2611 if ( new_offset != base_offset )
evaluated: new_offset != base_offset
TRUEFALSE
yes
Evaluation Count:2209
yes
Evaluation Count:2462
2209-2462
2612 { -
2613 cur_offset = _hb_stream_pos( stream ); -
2614 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:2209
0-2209
2615 ( error = Load_ChainSubClassSet( ccsf2, &cscs[n], 0-2209
2616 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_ChainSubClassSet( ccsf2, &cscs[n], stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2209
0-2209
2617 goto Fail1;
never executed: goto Fail1;
0
2618 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
2619 }
executed: }
Execution Count:2209
2209
2620 else -
2621 { -
2622 -
2623 -
2624 ccsf2->ChainSubClassSet[n].ChainSubClassRuleCount = 0; -
2625 ccsf2->ChainSubClassSet[n].ChainSubClassRule = ((void *)0); -
2626 }
executed: }
Execution Count:2462
2462
2627 } -
2628 -
2629 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:1475
1475
2630 -
2631Fail1: -
2632 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
2633 Free_ChainSubClassSet( &cscs[m] );
never executed: Free_ChainSubClassSet( &cscs[m] );
0
2634 -
2635 do { if ( (cscs) ) { _hb_free( cscs ); cscs = ((void *)0); } } while (0);
never evaluated: (cscs)
never evaluated: 0
never executed: }
never executed: }
0
2636 -
2637Fail2:
code before this statement never executed: Fail2:
0
2638 _HB_OPEN_Free_ClassDefinition( &ccsf2->LookaheadClassDef ); -
2639 -
2640Fail3:
code before this statement never executed: Fail3:
0
2641 _HB_OPEN_Free_ClassDefinition( &ccsf2->InputClassDef ); -
2642 -
2643Fail4:
code before this statement never executed: Fail4:
0
2644 _HB_OPEN_Free_ClassDefinition( &ccsf2->BacktrackClassDef ); -
2645 -
2646Fail5:
code before this statement never executed: Fail5:
0
2647 _HB_OPEN_Free_Coverage( &ccsf2->Coverage ); -
2648 return error;
never executed: return error;
0
2649} -
2650 -
2651 -
2652static void Free_ChainContextSubst2( HB_ChainContextSubstFormat2* ccsf2 ) -
2653{ -
2654 HB_UShort n, count; -
2655 -
2656 HB_ChainSubClassSet* cscs; -
2657 -
2658 -
2659 if ( ccsf2->ChainSubClassSet )
partially evaluated: ccsf2->ChainSubClassSet
TRUEFALSE
yes
Evaluation Count:1402
no
Evaluation Count:0
0-1402
2660 { -
2661 count = ccsf2->ChainSubClassSetCount; -
2662 cscs = ccsf2->ChainSubClassSet; -
2663 -
2664 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:4439
yes
Evaluation Count:1402
1402-4439
2665 Free_ChainSubClassSet( &cscs[n] );
executed: Free_ChainSubClassSet( &cscs[n] );
Execution Count:4439
4439
2666 -
2667 do { if ( (cscs) ) { _hb_free( cscs ); cscs = ((void *)0); } } while (0);
partially evaluated: (cscs)
TRUEFALSE
yes
Evaluation Count:1402
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1402
executed: }
Execution Count:1402
executed: }
Execution Count:1402
0-1402
2668 }
executed: }
Execution Count:1402
1402
2669 -
2670 _HB_OPEN_Free_ClassDefinition( &ccsf2->LookaheadClassDef ); -
2671 _HB_OPEN_Free_ClassDefinition( &ccsf2->InputClassDef ); -
2672 _HB_OPEN_Free_ClassDefinition( &ccsf2->BacktrackClassDef ); -
2673 -
2674 _HB_OPEN_Free_Coverage( &ccsf2->Coverage ); -
2675}
executed: }
Execution Count:1402
1402
2676 -
2677 -
2678 -
2679 -
2680static HB_Error Load_ChainContextSubst3( -
2681 HB_ChainContextSubstFormat3* ccsf3, -
2682 HB_Stream stream ) -
2683{ -
2684 HB_Error error; -
2685 -
2686 HB_UShort n, nb = 0, ni =0, nl = 0, m, count; -
2687 HB_UShort backtrack_count, input_count, lookahead_count; -
2688 HB_UInt cur_offset, new_offset, base_offset; -
2689 -
2690 HB_Coverage* b; -
2691 HB_Coverage* i; -
2692 HB_Coverage* l; -
2693 HB_SubstLookupRecord* slr; -
2694 -
2695 -
2696 base_offset = _hb_stream_pos( stream ) - 2L; -
2697 -
2698 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2699 return error;
never executed: return error;
0
2700 -
2701 ccsf3->BacktrackGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2702 -
2703 _hb_stream_frame_exit( stream ); -
2704 -
2705 ccsf3->BacktrackCoverage = ((void *)0); -
2706 -
2707 backtrack_count = ccsf3->BacktrackGlyphCount; -
2708 -
2709 if ( ( (ccsf3->BacktrackCoverage) = _hb_alloc( (backtrack_count)*sizeof(HB_Coverage), &error ), error != 0 ) )
never evaluated: ( (ccsf3->BacktrackCoverage) = _hb_alloc( (backtrack_count)*sizeof(HB_Coverage), &error ), error != 0 )
0
2710 -
2711 return error;
never executed: return error;
0
2712 -
2713 b = ccsf3->BacktrackCoverage; -
2714 -
2715 for ( nb = 0; nb < backtrack_count; nb++ )
never evaluated: nb < backtrack_count
0
2716 { -
2717 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2718 goto Fail4;
never executed: goto Fail4;
0
2719 -
2720 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
2721 -
2722 _hb_stream_frame_exit( stream ); -
2723 -
2724 cur_offset = _hb_stream_pos( stream ); -
2725 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
2726 ( 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
2727 goto Fail4;
never executed: goto Fail4;
0
2728 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
2729 }
never executed: }
0
2730 -
2731 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2732 goto Fail4;
never executed: goto Fail4;
0
2733 -
2734 ccsf3->InputGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2735 -
2736 _hb_stream_frame_exit( stream ); -
2737 -
2738 ccsf3->InputCoverage = ((void *)0); -
2739 -
2740 input_count = ccsf3->InputGlyphCount; -
2741 -
2742 if ( ( (ccsf3->InputCoverage) = _hb_alloc( (input_count)*sizeof(HB_Coverage), &error ), error != 0 ) )
never evaluated: ( (ccsf3->InputCoverage) = _hb_alloc( (input_count)*sizeof(HB_Coverage), &error ), error != 0 )
0
2743 goto Fail4;
never executed: goto Fail4;
0
2744 -
2745 i = ccsf3->InputCoverage; -
2746 -
2747 for ( ni = 0; ni < input_count; ni++ )
never evaluated: ni < input_count
0
2748 { -
2749 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2750 goto Fail3;
never executed: goto Fail3;
0
2751 -
2752 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
2753 -
2754 _hb_stream_frame_exit( stream ); -
2755 -
2756 cur_offset = _hb_stream_pos( stream ); -
2757 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
2758 ( 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
2759 goto Fail3;
never executed: goto Fail3;
0
2760 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
2761 }
never executed: }
0
2762 -
2763 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2764 goto Fail3;
never executed: goto Fail3;
0
2765 -
2766 ccsf3->LookaheadGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2767 -
2768 _hb_stream_frame_exit( stream ); -
2769 -
2770 ccsf3->LookaheadCoverage = ((void *)0); -
2771 -
2772 lookahead_count = ccsf3->LookaheadGlyphCount; -
2773 -
2774 if ( ( (ccsf3->LookaheadCoverage) = _hb_alloc( (lookahead_count)*sizeof(HB_Coverage), &error ), error != 0 ) )
never evaluated: ( (ccsf3->LookaheadCoverage) = _hb_alloc( (lookahead_count)*sizeof(HB_Coverage), &error ), error != 0 )
0
2775 -
2776 goto Fail3;
never executed: goto Fail3;
0
2777 -
2778 l = ccsf3->LookaheadCoverage; -
2779 -
2780 for ( nl = 0; nl < lookahead_count; nl++ )
never evaluated: nl < lookahead_count
0
2781 { -
2782 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2783 goto Fail2;
never executed: goto Fail2;
0
2784 -
2785 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
2786 -
2787 _hb_stream_frame_exit( stream ); -
2788 -
2789 cur_offset = _hb_stream_pos( stream ); -
2790 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
2791 ( 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
2792 goto Fail2;
never executed: goto Fail2;
0
2793 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
2794 }
never executed: }
0
2795 -
2796 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2797 goto Fail2;
never executed: goto Fail2;
0
2798 -
2799 ccsf3->SubstCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2800 -
2801 _hb_stream_frame_exit( stream ); -
2802 -
2803 ccsf3->SubstLookupRecord = ((void *)0); -
2804 -
2805 count = ccsf3->SubstCount; -
2806 -
2807 if ( ( (ccsf3->SubstLookupRecord) = _hb_alloc( (count)*sizeof(HB_SubstLookupRecord), &error ), error != 0 ) )
never evaluated: ( (ccsf3->SubstLookupRecord) = _hb_alloc( (count)*sizeof(HB_SubstLookupRecord), &error ), error != 0 )
0
2808 -
2809 goto Fail2;
never executed: goto Fail2;
0
2810 -
2811 slr = ccsf3->SubstLookupRecord; -
2812 -
2813 if ( ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 )
0
2814 goto Fail1;
never executed: goto Fail1;
0
2815 -
2816 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
2817 { -
2818 slr[n].SequenceIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2819 slr[n].LookupListIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2820 }
never executed: }
0
2821 -
2822 _hb_stream_frame_exit( stream ); -
2823 -
2824 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
2825 -
2826Fail1: -
2827 do { if ( (slr) ) { _hb_free( slr ); slr = ((void *)0); } } while (0);
never evaluated: (slr)
never evaluated: 0
never executed: }
never executed: }
0
2828 -
2829Fail2:
code before this statement never executed: Fail2:
0
2830 for ( m = 0; m < nl; m++ )
never evaluated: m < nl
0
2831 _HB_OPEN_Free_Coverage( &l[m] );
never executed: _HB_OPEN_Free_Coverage( &l[m] );
0
2832 -
2833 do { if ( (l) ) { _hb_free( l ); l = ((void *)0); } } while (0);
never evaluated: (l)
never evaluated: 0
never executed: }
never executed: }
0
2834 -
2835Fail3:
code before this statement never executed: Fail3:
0
2836 for ( m = 0; m < ni; m++ )
never evaluated: m < ni
0
2837 _HB_OPEN_Free_Coverage( &i[m] );
never executed: _HB_OPEN_Free_Coverage( &i[m] );
0
2838 -
2839 do { if ( (i) ) { _hb_free( i ); i = ((void *)0); } } while (0);
never evaluated: (i)
never evaluated: 0
never executed: }
never executed: }
0
2840 -
2841Fail4:
code before this statement never executed: Fail4:
0
2842 for ( m = 0; m < nb; m++ )
never evaluated: m < nb
0
2843 _HB_OPEN_Free_Coverage( &b[m] );
never executed: _HB_OPEN_Free_Coverage( &b[m] );
0
2844 -
2845 do { if ( (b) ) { _hb_free( b ); b = ((void *)0); } } while (0);
never evaluated: (b)
never evaluated: 0
never executed: }
never executed: }
0
2846 return error;
never executed: return error;
0
2847} -
2848 -
2849 -
2850static void Free_ChainContextSubst3( HB_ChainContextSubstFormat3* ccsf3 ) -
2851{ -
2852 HB_UShort n, count; -
2853 -
2854 HB_Coverage* c; -
2855 -
2856 -
2857 do { if ( (ccsf3->SubstLookupRecord) ) { _hb_free( ccsf3->SubstLookupRecord ); ccsf3->SubstLookupRecord = ((void *)0); } } while (0);
never evaluated: (ccsf3->SubstLookupRecord)
never evaluated: 0
never executed: }
never executed: }
0
2858 -
2859 if ( ccsf3->LookaheadCoverage )
never evaluated: ccsf3->LookaheadCoverage
0
2860 { -
2861 count = ccsf3->LookaheadGlyphCount; -
2862 c = ccsf3->LookaheadCoverage; -
2863 -
2864 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
2865 _HB_OPEN_Free_Coverage( &c[n] );
never executed: _HB_OPEN_Free_Coverage( &c[n] );
0
2866 -
2867 do { if ( (c) ) { _hb_free( c ); c = ((void *)0); } } while (0);
never evaluated: (c)
never evaluated: 0
never executed: }
never executed: }
0
2868 }
never executed: }
0
2869 -
2870 if ( ccsf3->InputCoverage )
never evaluated: ccsf3->InputCoverage
0
2871 { -
2872 count = ccsf3->InputGlyphCount; -
2873 c = ccsf3->InputCoverage; -
2874 -
2875 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
2876 _HB_OPEN_Free_Coverage( &c[n] );
never executed: _HB_OPEN_Free_Coverage( &c[n] );
0
2877 -
2878 do { if ( (c) ) { _hb_free( c ); c = ((void *)0); } } while (0);
never evaluated: (c)
never evaluated: 0
never executed: }
never executed: }
0
2879 }
never executed: }
0
2880 -
2881 if ( ccsf3->BacktrackCoverage )
never evaluated: ccsf3->BacktrackCoverage
0
2882 { -
2883 count = ccsf3->BacktrackGlyphCount; -
2884 c = ccsf3->BacktrackCoverage; -
2885 -
2886 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
2887 _HB_OPEN_Free_Coverage( &c[n] );
never executed: _HB_OPEN_Free_Coverage( &c[n] );
0
2888 -
2889 do { if ( (c) ) { _hb_free( c ); c = ((void *)0); } } while (0);
never evaluated: (c)
never evaluated: 0
never executed: }
never executed: }
0
2890 }
never executed: }
0
2891}
never executed: }
0
2892 -
2893 -
2894 -
2895 -
2896static HB_Error Load_ChainContextSubst( HB_GSUB_SubTable* st, -
2897 HB_Stream stream ) -
2898{ -
2899 HB_Error error; -
2900 HB_ChainContextSubst* ccs = &st->chain; -
2901 -
2902 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:1475
0-1475
2903 return error;
never executed: return error;
0
2904 -
2905 ccs->SubstFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
2906 -
2907 _hb_stream_frame_exit( stream ); -
2908 -
2909 switch ( ccs->SubstFormat ) { -
2910 case 1: return Load_ChainContextSubst1( &ccs->ccsf.ccsf1, stream );
never executed: return Load_ChainContextSubst1( &ccs->ccsf.ccsf1, stream );
0
2911 case 2: return Load_ChainContextSubst2( &ccs->ccsf.ccsf2, stream );
executed: return Load_ChainContextSubst2( &ccs->ccsf.ccsf2, stream );
Execution Count:1475
1475
2912 case 3: return Load_ChainContextSubst3( &ccs->ccsf.ccsf3, stream );
never executed: return Load_ChainContextSubst3( &ccs->ccsf.ccsf3, stream );
0
2913 default: return _hb_err (HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
2914 } -
2915 -
2916 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
2917} -
2918 -
2919 -
2920static void Free_ChainContextSubst( HB_GSUB_SubTable* st ) -
2921{ -
2922 HB_ChainContextSubst* ccs = &st->chain; -
2923 -
2924 switch ( ccs->SubstFormat ) { -
2925 case 1: Free_ChainContextSubst1( &ccs->ccsf.ccsf1 ); break;
never executed: break;
0
2926 case 2: Free_ChainContextSubst2( &ccs->ccsf.ccsf2 ); break;
executed: break;
Execution Count:1402
1402
2927 case 3: Free_ChainContextSubst3( &ccs->ccsf.ccsf3 ); break;
never executed: break;
0
2928 default: break;
never executed: break;
0
2929 } -
2930}
executed: }
Execution Count:1402
1402
2931 -
2932 -
2933static HB_Error Lookup_ChainContextSubst1( HB_GSUBHeader* gsub, -
2934 HB_ChainContextSubstFormat1* ccsf1, -
2935 HB_Buffer buffer, -
2936 HB_UShort flags, -
2937 HB_UShort context_length, -
2938 int nesting_level ) -
2939{ -
2940 HB_UShort index, property; -
2941 HB_UShort i, j, k, num_csr; -
2942 HB_UShort bgc, igc, lgc; -
2943 HB_Error error; -
2944 -
2945 HB_ChainSubRule* csr; -
2946 HB_ChainSubRule curr_csr; -
2947 HB_GDEFHeader* gdef; -
2948 -
2949 -
2950 gdef = gsub->gdef; -
2951 -
2952 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
2953 return error;
never executed: return error;
0
2954 -
2955 error = _HB_OPEN_Coverage_Index( &ccsf1->Coverage, (buffer->in_string[buffer->in_pos].gindex), &index ); -
2956 if ( error )
never evaluated: error
0
2957 return error;
never executed: return error;
0
2958 -
2959 csr = ccsf1->ChainSubRuleSet[index].ChainSubRule; -
2960 num_csr = ccsf1->ChainSubRuleSet[index].ChainSubRuleCount; -
2961 -
2962 for ( k = 0; k < num_csr; k++ )
never evaluated: k < num_csr
0
2963 { -
2964 curr_csr = csr[k]; -
2965 bgc = curr_csr.BacktrackGlyphCount; -
2966 igc = curr_csr.InputGlyphCount; -
2967 lgc = curr_csr.LookaheadGlyphCount; -
2968 -
2969 if ( context_length != 0xFFFF && context_length < igc )
never evaluated: context_length != 0xFFFF
never evaluated: context_length < igc
0
2970 goto next_chainsubrule;
never executed: goto next_chainsubrule;
0
2971 -
2972 -
2973 -
2974 if ( bgc > buffer->out_pos || buffer->in_pos + igc + lgc > buffer->in_length )
never evaluated: bgc > buffer->out_pos
never evaluated: buffer->in_pos + igc + lgc > buffer->in_length
0
2975 goto next_chainsubrule;
never executed: goto next_chainsubrule;
0
2976 -
2977 if ( bgc )
never evaluated: bgc
0
2978 { -
2979 -
2980 -
2981 -
2982 for ( i = 0, j = buffer->out_pos - 1; i < bgc; i++, j-- )
never evaluated: i < bgc
0
2983 { -
2984 while ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->out_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->out_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
2985 { -
2986 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
2987 return error;
never executed: return error;
0
2988 -
2989 if ( j + 1 == bgc - i )
never evaluated: j + 1 == bgc - i
0
2990 goto next_chainsubrule;
never executed: goto next_chainsubrule;
0
2991 j--; -
2992 }
never executed: }
0
2993 if ( (buffer->out_string[(j)].gindex) != curr_csr.Backtrack[i] )
never evaluated: (buffer->out_string[(j)].gindex) != curr_csr.Backtrack[i]
0
2994 goto next_chainsubrule;
never executed: goto next_chainsubrule;
0
2995 }
never executed: }
0
2996 }
never executed: }
0
2997 -
2998 -
2999 -
3000 for ( i = 1, j = buffer->in_pos + 1; i < igc; i++, j++ )
never evaluated: i < igc
0
3001 { -
3002 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
3003 { -
3004 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3005 return error;
never executed: return error;
0
3006 -
3007 if ( j + igc - i + lgc == (HB_Int)buffer->in_length )
never evaluated: j + igc - i + lgc == (HB_Int)buffer->in_length
0
3008 goto next_chainsubrule;
never executed: goto next_chainsubrule;
0
3009 j++; -
3010 }
never executed: }
0
3011 -
3012 if ( (buffer->in_string[(j)].gindex) != curr_csr.Input[i - 1] )
never evaluated: (buffer->in_string[(j)].gindex) != curr_csr.Input[i - 1]
0
3013 goto next_chainsubrule;
never executed: goto next_chainsubrule;
0
3014 }
never executed: }
0
3015 -
3016 -
3017 -
3018 -
3019 for ( i = 0; i < lgc; i++, j++ )
never evaluated: i < lgc
0
3020 { -
3021 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
3022 { -
3023 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3024 return error;
never executed: return error;
0
3025 -
3026 if ( j + lgc - i == (HB_Int)buffer->in_length )
never evaluated: j + lgc - i == (HB_Int)buffer->in_length
0
3027 goto next_chainsubrule;
never executed: goto next_chainsubrule;
0
3028 j++; -
3029 }
never executed: }
0
3030 -
3031 if ( (buffer->in_string[(j)].gindex) != curr_csr.Lookahead[i] )
never evaluated: (buffer->in_string[(j)].gindex) != curr_csr.Lookahead[i]
0
3032 goto next_chainsubrule;
never executed: goto next_chainsubrule;
0
3033 }
never executed: }
0
3034 -
3035 return Do_ContextSubst( gsub, igc, 0
3036 curr_csr.SubstCount, 0
3037 curr_csr.SubstLookupRecord, 0
3038 buffer, 0
3039 nesting_level );
never executed: return Do_ContextSubst( gsub, igc, curr_csr.SubstCount, curr_csr.SubstLookupRecord, buffer, nesting_level );
0
3040 -
3041 next_chainsubrule: -
3042 ; -
3043 }
never executed: }
0
3044 -
3045 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3046} -
3047 -
3048 -
3049static HB_Error Lookup_ChainContextSubst2( HB_GSUBHeader* gsub, -
3050 HB_ChainContextSubstFormat2* ccsf2, -
3051 HB_Buffer buffer, -
3052 HB_UShort flags, -
3053 HB_UShort context_length, -
3054 int nesting_level ) -
3055{ -
3056 HB_UShort index, property; -
3057 HB_Error error; -
3058 HB_UShort i, j, k; -
3059 HB_UShort bgc, igc, lgc; -
3060 HB_UShort known_backtrack_classes, -
3061 known_input_classes, -
3062 known_lookahead_classes; -
3063 -
3064 HB_UShort* backtrack_classes; -
3065 HB_UShort* input_classes; -
3066 HB_UShort* lookahead_classes; -
3067 -
3068 HB_UShort* bc; -
3069 HB_UShort* ic; -
3070 HB_UShort* lc; -
3071 -
3072 HB_ChainSubClassSet* cscs; -
3073 HB_ChainSubClassRule ccsr; -
3074 HB_GDEFHeader* gdef; -
3075 -
3076 -
3077 gdef = gsub->gdef; -
3078 -
3079 if ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok ) )
partially evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:32060924
0-32060924
3080 return error;
never executed: return error;
0
3081 -
3082 -
3083 -
3084 -
3085 -
3086 error = _HB_OPEN_Coverage_Index( &ccsf2->Coverage, (buffer->in_string[buffer->in_pos].gindex), &index ); -
3087 if ( error )
evaluated: error
TRUEFALSE
yes
Evaluation Count:31960937
yes
Evaluation Count:99987
99987-31960937
3088 return error;
executed: return error;
Execution Count:31960937
31960937
3089 -
3090 if ( ( (backtrack_classes) = _hb_alloc( (ccsf2->MaxBacktrackLength)*sizeof(HB_UShort), &error ), error != 0 ) )
partially evaluated: ( (backtrack_classes) = _hb_alloc( (ccsf2->MaxBacktrackLength)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:99987
0-99987
3091 return error;
never executed: return error;
0
3092 known_backtrack_classes = 0; -
3093 -
3094 if (ccsf2->MaxInputLength < 1)
partially evaluated: ccsf2->MaxInputLength < 1
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:99987
0-99987
3095 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3096 -
3097 if ( ( (input_classes) = _hb_alloc( (ccsf2->MaxInputLength)*sizeof(HB_UShort), &error ), error != 0 ) )
partially evaluated: ( (input_classes) = _hb_alloc( (ccsf2->MaxInputLength)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:99987
0-99987
3098 goto End3;
never executed: goto End3;
0
3099 known_input_classes = 1; -
3100 -
3101 if ( ( (lookahead_classes) = _hb_alloc( (ccsf2->MaxLookaheadLength)*sizeof(HB_UShort), &error ), error != 0 ) )
partially evaluated: ( (lookahead_classes) = _hb_alloc( (ccsf2->MaxLookaheadLength)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:99987
0-99987
3102 goto End2;
never executed: goto End2;
0
3103 known_lookahead_classes = 0; -
3104 -
3105 error = _HB_OPEN_Get_Class( &ccsf2->InputClassDef, (buffer->in_string[buffer->in_pos].gindex), -
3106 &input_classes[0], ((void *)0) ); -
3107 if ( error && error != HB_Err_Not_Covered )
partially evaluated: error
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:99987
never evaluated: error != HB_Err_Not_Covered
0-99987
3108 goto End1;
never executed: goto End1;
0
3109 -
3110 cscs = &ccsf2->ChainSubClassSet[input_classes[0]]; -
3111 if ( !cscs )
partially evaluated: !cscs
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:99987
0-99987
3112 { -
3113 error = _hb_err (HB_Err_Invalid_SubTable); -
3114 goto End1;
never executed: goto End1;
0
3115 } -
3116 -
3117 for ( k = 0; k < cscs->ChainSubClassRuleCount; k++ )
evaluated: k < cscs->ChainSubClassRuleCount
TRUEFALSE
yes
Evaluation Count:299959
yes
Evaluation Count:99987
99987-299959
3118 { -
3119 ccsr = cscs->ChainSubClassRule[k]; -
3120 bgc = ccsr.BacktrackGlyphCount; -
3121 igc = ccsr.InputGlyphCount; -
3122 lgc = ccsr.LookaheadGlyphCount; -
3123 -
3124 if ( context_length != 0xFFFF && context_length < igc )
partially evaluated: context_length != 0xFFFF
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:299959
never evaluated: context_length < igc
0-299959
3125 goto next_chainsubclassrule;
never executed: goto next_chainsubclassrule;
0
3126 -
3127 -
3128 -
3129 if ( bgc > buffer->out_pos || buffer->in_pos + igc + lgc > buffer->in_length )
partially evaluated: bgc > buffer->out_pos
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:299959
evaluated: buffer->in_pos + igc + lgc > buffer->in_length
TRUEFALSE
yes
Evaluation Count:13203
yes
Evaluation Count:286756
0-299959
3130 goto next_chainsubclassrule;
executed: goto next_chainsubclassrule;
Execution Count:13203
13203
3131 -
3132 if ( bgc )
partially evaluated: bgc
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:286756
0-286756
3133 { -
3134 -
3135 -
3136 -
3137 -
3138 bc = ccsr.Backtrack; -
3139 -
3140 for ( i = 0, j = buffer->out_pos - 1; i < bgc; i++, j-- )
never evaluated: i < bgc
0
3141 { -
3142 while ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->out_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->out_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
3143 { -
3144 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3145 goto End1;
never executed: goto End1;
0
3146 -
3147 if ( j + 1 == bgc - i )
never evaluated: j + 1 == bgc - i
0
3148 goto next_chainsubclassrule;
never executed: goto next_chainsubclassrule;
0
3149 j--; -
3150 }
never executed: }
0
3151 -
3152 if ( i >= known_backtrack_classes )
never evaluated: i >= known_backtrack_classes
0
3153 { -
3154 -
3155 -
3156 error = _HB_OPEN_Get_Class( &ccsf2->BacktrackClassDef, (buffer->out_string[(j)].gindex), -
3157 &backtrack_classes[i], ((void *)0) ); -
3158 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3159 goto End1;
never executed: goto End1;
0
3160 known_backtrack_classes = i; -
3161 }
never executed: }
0
3162 -
3163 if ( bc[i] != backtrack_classes[i] )
never evaluated: bc[i] != backtrack_classes[i]
0
3164 goto next_chainsubclassrule;
never executed: goto next_chainsubclassrule;
0
3165 }
never executed: }
0
3166 }
never executed: }
0
3167 -
3168 ic = ccsr.Input; -
3169 -
3170 -
3171 -
3172 for ( i = 1, j = buffer->in_pos + 1; i < igc; i++, j++ )
partially evaluated: i < igc
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:286756
0-286756
3173 { -
3174 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
3175 { -
3176 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3177 goto End1;
never executed: goto End1;
0
3178 -
3179 if ( j + igc - i + lgc == (HB_Int)buffer->in_length )
never evaluated: j + igc - i + lgc == (HB_Int)buffer->in_length
0
3180 goto next_chainsubclassrule;
never executed: goto next_chainsubclassrule;
0
3181 j++; -
3182 }
never executed: }
0
3183 -
3184 if ( i >= known_input_classes )
never evaluated: i >= known_input_classes
0
3185 { -
3186 error = _HB_OPEN_Get_Class( &ccsf2->InputClassDef, (buffer->in_string[(j)].gindex), -
3187 &input_classes[i], ((void *)0) ); -
3188 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3189 goto End1;
never executed: goto End1;
0
3190 known_input_classes = i; -
3191 }
never executed: }
0
3192 -
3193 if ( ic[i - 1] != input_classes[i] )
never evaluated: ic[i - 1] != input_classes[i]
0
3194 goto next_chainsubclassrule;
never executed: goto next_chainsubclassrule;
0
3195 }
never executed: }
0
3196 -
3197 -
3198 -
3199 -
3200 lc = ccsr.Lookahead; -
3201 -
3202 for ( i = 0; i < lgc; i++, j++ )
partially evaluated: i < lgc
TRUEFALSE
yes
Evaluation Count:286756
no
Evaluation Count:0
0-286756
3203 { -
3204 while ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok ) )
partially evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:286756
0-286756
3205 { -
3206 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3207 goto End1;
never executed: goto End1;
0
3208 -
3209 if ( j + lgc - i == (HB_Int)buffer->in_length )
never evaluated: j + lgc - i == (HB_Int)buffer->in_length
0
3210 goto next_chainsubclassrule;
never executed: goto next_chainsubclassrule;
0
3211 j++; -
3212 }
never executed: }
0
3213 -
3214 if ( i >= known_lookahead_classes )
partially evaluated: i >= known_lookahead_classes
TRUEFALSE
yes
Evaluation Count:286756
no
Evaluation Count:0
0-286756
3215 { -
3216 error = _HB_OPEN_Get_Class( &ccsf2->LookaheadClassDef, (buffer->in_string[(j)].gindex), -
3217 &lookahead_classes[i], ((void *)0) ); -
3218 if ( error && error != HB_Err_Not_Covered )
evaluated: error
TRUEFALSE
yes
Evaluation Count:159774
yes
Evaluation Count:126982
partially evaluated: error != HB_Err_Not_Covered
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:159774
0-159774
3219 goto End1;
never executed: goto End1;
0
3220 known_lookahead_classes = i; -
3221 }
executed: }
Execution Count:286756
286756
3222 -
3223 if ( lc[i] != lookahead_classes[i] )
partially evaluated: lc[i] != lookahead_classes[i]
TRUEFALSE
yes
Evaluation Count:286756
no
Evaluation Count:0
0-286756
3224 goto next_chainsubclassrule;
executed: goto next_chainsubclassrule;
Execution Count:286756
286756
3225 }
never executed: }
0
3226 -
3227 error = Do_ContextSubst( gsub, igc, -
3228 ccsr.SubstCount, -
3229 ccsr.SubstLookupRecord, -
3230 buffer, -
3231 nesting_level ); -
3232 goto End1;
never executed: goto End1;
0
3233 -
3234 next_chainsubclassrule: -
3235 ; -
3236 }
executed: }
Execution Count:299959
299959
3237 -
3238 error = HB_Err_Not_Covered; -
3239 -
3240End1:
code before this statement executed: End1:
Execution Count:99987
99987
3241 do { if ( (lookahead_classes) ) { _hb_free( lookahead_classes ); lookahead_classes = ((void *)0); } } while (0);
partially evaluated: (lookahead_classes)
TRUEFALSE
yes
Evaluation Count:99987
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:99987
executed: }
Execution Count:99987
executed: }
Execution Count:99987
0-99987
3242 -
3243End2:
code before this statement executed: End2:
Execution Count:99987
99987
3244 do { if ( (input_classes) ) { _hb_free( input_classes ); input_classes = ((void *)0); } } while (0);
partially evaluated: (input_classes)
TRUEFALSE
yes
Evaluation Count:99987
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:99987
executed: }
Execution Count:99987
executed: }
Execution Count:99987
0-99987
3245 -
3246End3:
code before this statement executed: End3:
Execution Count:99987
99987
3247 do { if ( (backtrack_classes) ) { _hb_free( backtrack_classes ); backtrack_classes = ((void *)0); } } while (0);
evaluated: (backtrack_classes)
TRUEFALSE
yes
Evaluation Count:99986
yes
Evaluation Count:1
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:99987
executed: }
Execution Count:99986
executed: }
Execution Count:99987
0-99987
3248 return error;
executed: return error;
Execution Count:99987
99987
3249} -
3250 -
3251 -
3252static HB_Error Lookup_ChainContextSubst3( HB_GSUBHeader* gsub, -
3253 HB_ChainContextSubstFormat3* ccsf3, -
3254 HB_Buffer buffer, -
3255 HB_UShort flags, -
3256 HB_UShort context_length, -
3257 int nesting_level ) -
3258{ -
3259 HB_UShort index, i, j, property; -
3260 HB_UShort bgc, igc, lgc; -
3261 HB_Error error; -
3262 -
3263 HB_Coverage* bc; -
3264 HB_Coverage* ic; -
3265 HB_Coverage* lc; -
3266 HB_GDEFHeader* gdef; -
3267 -
3268 -
3269 gdef = gsub->gdef; -
3270 -
3271 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
3272 return error;
never executed: return error;
0
3273 -
3274 bgc = ccsf3->BacktrackGlyphCount; -
3275 igc = ccsf3->InputGlyphCount; -
3276 lgc = ccsf3->LookaheadGlyphCount; -
3277 -
3278 if ( context_length != 0xFFFF && context_length < igc )
never evaluated: context_length != 0xFFFF
never evaluated: context_length < igc
0
3279 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3280 -
3281 -
3282 -
3283 if ( bgc > buffer->out_pos || buffer->in_pos + igc + lgc > buffer->in_length )
never evaluated: bgc > buffer->out_pos
never evaluated: buffer->in_pos + igc + lgc > buffer->in_length
0
3284 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3285 -
3286 if ( bgc )
never evaluated: bgc
0
3287 { -
3288 -
3289 -
3290 -
3291 bc = ccsf3->BacktrackCoverage; -
3292 -
3293 for ( i = 0, j = buffer->out_pos - 1; i < bgc; i++, j-- )
never evaluated: i < bgc
0
3294 { -
3295 while ( ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->out_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->out_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
3296 { -
3297 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3298 return error;
never executed: return error;
0
3299 -
3300 if ( j + 1 == bgc - i )
never evaluated: j + 1 == bgc - i
0
3301 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3302 j--; -
3303 }
never executed: }
0
3304 -
3305 error = _HB_OPEN_Coverage_Index( &bc[i], (buffer->out_string[(j)].gindex), &index ); -
3306 if ( error )
never evaluated: error
0
3307 return error;
never executed: return error;
0
3308 }
never executed: }
0
3309 }
never executed: }
0
3310 -
3311 ic = ccsf3->InputCoverage; -
3312 -
3313 for ( i = 0, j = buffer->in_pos; i < igc; i++, j++ )
never evaluated: i < igc
0
3314 { -
3315 -
3316 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
3317 { -
3318 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3319 return error;
never executed: return error;
0
3320 -
3321 if ( j + igc - i + lgc == (HB_Int)buffer->in_length )
never evaluated: j + igc - i + lgc == (HB_Int)buffer->in_length
0
3322 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3323 j++; -
3324 }
never executed: }
0
3325 -
3326 error = _HB_OPEN_Coverage_Index( &ic[i], (buffer->in_string[(j)].gindex), &index ); -
3327 if ( error )
never evaluated: error
0
3328 return error;
never executed: return error;
0
3329 }
never executed: }
0
3330 -
3331 -
3332 -
3333 -
3334 lc = ccsf3->LookaheadCoverage; -
3335 -
3336 for ( i = 0; i < lgc; i++, j++ )
never evaluated: i < lgc
0
3337 { -
3338 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
3339 { -
3340 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3341 return error;
never executed: return error;
0
3342 -
3343 if ( j + lgc - i == (HB_Int)buffer->in_length )
never evaluated: j + lgc - i == (HB_Int)buffer->in_length
0
3344 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3345 j++; -
3346 }
never executed: }
0
3347 -
3348 error = _HB_OPEN_Coverage_Index( &lc[i], (buffer->in_string[(j)].gindex), &index ); -
3349 if ( error )
never evaluated: error
0
3350 return error;
never executed: return error;
0
3351 }
never executed: }
0
3352 -
3353 return Do_ContextSubst( gsub, igc, 0
3354 ccsf3->SubstCount, 0
3355 ccsf3->SubstLookupRecord, 0
3356 buffer, 0
3357 nesting_level );
never executed: return Do_ContextSubst( gsub, igc, ccsf3->SubstCount, ccsf3->SubstLookupRecord, buffer, nesting_level );
0
3358} -
3359 -
3360 -
3361static HB_Error Lookup_ChainContextSubst( HB_GSUBHeader* gsub, -
3362 HB_GSUB_SubTable* st, -
3363 HB_Buffer buffer, -
3364 HB_UShort flags, -
3365 HB_UShort context_length, -
3366 int nesting_level ) -
3367{ -
3368 HB_ChainContextSubst* ccs = &st->chain; -
3369 -
3370 switch ( ccs->SubstFormat ) { -
3371 case 1: return Lookup_ChainContextSubst1( gsub, &ccs->ccsf.ccsf1, buffer, flags, context_length, nesting_level );
never executed: return Lookup_ChainContextSubst1( gsub, &ccs->ccsf.ccsf1, buffer, flags, context_length, nesting_level );
0
3372 case 2: return Lookup_ChainContextSubst2( gsub, &ccs->ccsf.ccsf2, buffer, flags, context_length, nesting_level );
executed: return Lookup_ChainContextSubst2( gsub, &ccs->ccsf.ccsf2, buffer, flags, context_length, nesting_level );
Execution Count:32060924
32060924
3373 case 3: return Lookup_ChainContextSubst3( gsub, &ccs->ccsf.ccsf3, buffer, flags, context_length, nesting_level );
never executed: return Lookup_ChainContextSubst3( gsub, &ccs->ccsf.ccsf3, buffer, flags, context_length, nesting_level );
0
3374 default: return _hb_err (HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
3375 } -
3376}
never executed: }
0
3377 -
3378 -
3379static HB_Error Load_ReverseChainContextSubst( HB_GSUB_SubTable* st, -
3380 HB_Stream stream ) -
3381{ -
3382 HB_Error error; -
3383 HB_ReverseChainContextSubst* rccs = &st->reverse; -
3384 -
3385 HB_UShort m, count; -
3386 -
3387 HB_UShort nb = 0, nl = 0, n; -
3388 HB_UShort backtrack_count, lookahead_count; -
3389 HB_UInt cur_offset, new_offset, base_offset; -
3390 -
3391 HB_Coverage* b; -
3392 HB_Coverage* l; -
3393 HB_UShort* sub; -
3394 -
3395 base_offset = _hb_stream_pos( stream ); -
3396 -
3397 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3398 return error;
never executed: return error;
0
3399 -
3400 rccs->SubstFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
3401 -
3402 if ( rccs->SubstFormat != 1 )
never evaluated: rccs->SubstFormat != 1
0
3403 return _hb_err (HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
3404 -
3405 _hb_stream_frame_exit( stream ); -
3406 -
3407 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3408 return error;
never executed: return error;
0
3409 -
3410 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
3411 -
3412 _hb_stream_frame_exit( stream ); -
3413 -
3414 cur_offset = _hb_stream_pos( stream ); -
3415 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
3416 ( error = _HB_OPEN_Load_Coverage( &rccs->Coverage, stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Coverage( &rccs->Coverage, stream ) ) != HB_Err_Ok
0
3417 return error;
never executed: return error;
0
3418 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
3419 -
3420 -
3421 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3422 goto Fail4;
never executed: goto Fail4;
0
3423 -
3424 rccs->BacktrackGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
3425 -
3426 _hb_stream_frame_exit( stream ); -
3427 -
3428 rccs->BacktrackCoverage = ((void *)0); -
3429 -
3430 backtrack_count = rccs->BacktrackGlyphCount; -
3431 -
3432 if ( ( (rccs->BacktrackCoverage) = _hb_alloc( (backtrack_count)*sizeof(HB_Coverage), &error ), error != 0 ) )
never evaluated: ( (rccs->BacktrackCoverage) = _hb_alloc( (backtrack_count)*sizeof(HB_Coverage), &error ), error != 0 )
0
3433 -
3434 goto Fail4;
never executed: goto Fail4;
0
3435 -
3436 b = rccs->BacktrackCoverage; -
3437 -
3438 for ( nb = 0; nb < backtrack_count; nb++ )
never evaluated: nb < backtrack_count
0
3439 { -
3440 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3441 goto Fail3;
never executed: goto Fail3;
0
3442 -
3443 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
3444 -
3445 _hb_stream_frame_exit( stream ); -
3446 -
3447 cur_offset = _hb_stream_pos( stream ); -
3448 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
3449 ( 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
3450 goto Fail3;
never executed: goto Fail3;
0
3451 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
3452 }
never executed: }
0
3453 -
3454 -
3455 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3456 goto Fail3;
never executed: goto Fail3;
0
3457 -
3458 rccs->LookaheadGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
3459 -
3460 _hb_stream_frame_exit( stream ); -
3461 -
3462 rccs->LookaheadCoverage = ((void *)0); -
3463 -
3464 lookahead_count = rccs->LookaheadGlyphCount; -
3465 -
3466 if ( ( (rccs->LookaheadCoverage) = _hb_alloc( (lookahead_count)*sizeof(HB_Coverage), &error ), error != 0 ) )
never evaluated: ( (rccs->LookaheadCoverage) = _hb_alloc( (lookahead_count)*sizeof(HB_Coverage), &error ), error != 0 )
0
3467 -
3468 goto Fail3;
never executed: goto Fail3;
0
3469 -
3470 l = rccs->LookaheadCoverage; -
3471 -
3472 for ( nl = 0; nl < lookahead_count; nl++ )
never evaluated: nl < lookahead_count
0
3473 { -
3474 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3475 goto Fail2;
never executed: goto Fail2;
0
3476 -
3477 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
3478 -
3479 _hb_stream_frame_exit( stream ); -
3480 -
3481 cur_offset = _hb_stream_pos( stream ); -
3482 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
3483 ( 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
3484 goto Fail2;
never executed: goto Fail2;
0
3485 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
3486 }
never executed: }
0
3487 -
3488 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3489 goto Fail2;
never executed: goto Fail2;
0
3490 -
3491 rccs->GlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
3492 -
3493 _hb_stream_frame_exit( stream ); -
3494 -
3495 rccs->Substitute = ((void *)0); -
3496 -
3497 count = rccs->GlyphCount; -
3498 -
3499 if ( ( (rccs->Substitute) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
never evaluated: ( (rccs->Substitute) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
0
3500 -
3501 goto Fail2;
never executed: goto Fail2;
0
3502 -
3503 sub = rccs->Substitute; -
3504 -
3505 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
0
3506 goto Fail1;
never executed: goto Fail1;
0
3507 -
3508 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
3509 sub[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
never executed: sub[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
0
3510 -
3511 _hb_stream_frame_exit( stream ); -
3512 -
3513 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
3514 -
3515Fail1: -
3516 do { if ( (sub) ) { _hb_free( sub ); sub = ((void *)0); } } while (0);
never evaluated: (sub)
never evaluated: 0
never executed: }
never executed: }
0
3517 -
3518Fail2:
code before this statement never executed: Fail2:
0
3519 for ( m = 0; m < nl; m++ )
never evaluated: m < nl
0
3520 _HB_OPEN_Free_Coverage( &l[m] );
never executed: _HB_OPEN_Free_Coverage( &l[m] );
0
3521 -
3522 do { if ( (l) ) { _hb_free( l ); l = ((void *)0); } } while (0);
never evaluated: (l)
never evaluated: 0
never executed: }
never executed: }
0
3523 -
3524Fail3:
code before this statement never executed: Fail3:
0
3525 for ( m = 0; m < nb; m++ )
never evaluated: m < nb
0
3526 _HB_OPEN_Free_Coverage( &b[m] );
never executed: _HB_OPEN_Free_Coverage( &b[m] );
0
3527 -
3528 do { if ( (b) ) { _hb_free( b ); b = ((void *)0); } } while (0);
never evaluated: (b)
never evaluated: 0
never executed: }
never executed: }
0
3529 -
3530Fail4:
code before this statement never executed: Fail4:
0
3531 _HB_OPEN_Free_Coverage( &rccs->Coverage ); -
3532 return error;
never executed: return error;
0
3533} -
3534 -
3535 -
3536static void Free_ReverseChainContextSubst( HB_GSUB_SubTable* st ) -
3537{ -
3538 HB_UShort n, count; -
3539 HB_ReverseChainContextSubst* rccs = &st->reverse; -
3540 -
3541 HB_Coverage* c; -
3542 -
3543 _HB_OPEN_Free_Coverage( &rccs->Coverage ); -
3544 -
3545 if ( rccs->LookaheadCoverage )
never evaluated: rccs->LookaheadCoverage
0
3546 { -
3547 count = rccs->LookaheadGlyphCount; -
3548 c = rccs->LookaheadCoverage; -
3549 -
3550 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
3551 _HB_OPEN_Free_Coverage( &c[n] );
never executed: _HB_OPEN_Free_Coverage( &c[n] );
0
3552 -
3553 do { if ( (c) ) { _hb_free( c ); c = ((void *)0); } } while (0);
never evaluated: (c)
never evaluated: 0
never executed: }
never executed: }
0
3554 }
never executed: }
0
3555 -
3556 if ( rccs->BacktrackCoverage )
never evaluated: rccs->BacktrackCoverage
0
3557 { -
3558 count = rccs->BacktrackGlyphCount; -
3559 c = rccs->BacktrackCoverage; -
3560 -
3561 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
3562 _HB_OPEN_Free_Coverage( &c[n] );
never executed: _HB_OPEN_Free_Coverage( &c[n] );
0
3563 -
3564 do { if ( (c) ) { _hb_free( c ); c = ((void *)0); } } while (0);
never evaluated: (c)
never evaluated: 0
never executed: }
never executed: }
0
3565 }
never executed: }
0
3566 -
3567 do { if ( (rccs->Substitute) ) { _hb_free( rccs->Substitute ); rccs->Substitute = ((void *)0); } } while (0);
never evaluated: (rccs->Substitute)
never evaluated: 0
never executed: }
never executed: }
0
3568}
never executed: }
0
3569 -
3570 -
3571static HB_Error Lookup_ReverseChainContextSubst( HB_GSUBHeader* gsub, -
3572 HB_GSUB_SubTable* st, -
3573 HB_Buffer buffer, -
3574 HB_UShort flags, -
3575 HB_UShort context_length, -
3576 int nesting_level ) -
3577{ -
3578 HB_UShort index, input_index, i, j, property; -
3579 HB_UShort bgc, lgc; -
3580 HB_Error error; -
3581 -
3582 HB_ReverseChainContextSubst* rccs = &st->reverse; -
3583 HB_Coverage* bc; -
3584 HB_Coverage* lc; -
3585 HB_GDEFHeader* gdef; -
3586 -
3587 if ( nesting_level != 1 || context_length != 0xFFFF )
never evaluated: nesting_level != 1
never evaluated: context_length != 0xFFFF
0
3588 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3589 -
3590 gdef = gsub->gdef; -
3591 -
3592 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
3593 return error;
never executed: return error;
0
3594 -
3595 bgc = rccs->BacktrackGlyphCount; -
3596 lgc = rccs->LookaheadGlyphCount; -
3597 -
3598 -
3599 -
3600 if ( bgc > buffer->in_pos || buffer->in_pos + 1 + lgc > buffer->in_length )
never evaluated: bgc > buffer->in_pos
never evaluated: buffer->in_pos + 1 + lgc > buffer->in_length
0
3601 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3602 -
3603 if ( bgc )
never evaluated: bgc
0
3604 { -
3605 -
3606 -
3607 -
3608 bc = rccs->BacktrackCoverage; -
3609 -
3610 for ( i = 0, j = buffer->in_pos - 1; i < bgc; i++, j-- )
never evaluated: i < bgc
0
3611 { -
3612 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
3613 { -
3614 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3615 return error;
never executed: return error;
0
3616 -
3617 if ( j + 1 == bgc - i )
never evaluated: j + 1 == bgc - i
0
3618 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3619 j--; -
3620 }
never executed: }
0
3621 -
3622 error = _HB_OPEN_Coverage_Index( &bc[i], (buffer->in_string[(j)].gindex), &index ); -
3623 if ( error )
never evaluated: error
0
3624 return error;
never executed: return error;
0
3625 }
never executed: }
0
3626 }
never executed: }
0
3627 -
3628 j = buffer->in_pos; -
3629 -
3630 error = _HB_OPEN_Coverage_Index( &rccs->Coverage, (buffer->in_string[(j)].gindex), &input_index ); -
3631 if ( error )
never evaluated: error
0
3632 return error;
never executed: return error;
0
3633 -
3634 lc = rccs->LookaheadCoverage; -
3635 -
3636 for ( i = 0, j = buffer->in_pos + 1; i < lgc; i++, j++ )
never evaluated: i < lgc
0
3637 { -
3638 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
3639 { -
3640 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3641 return error;
never executed: return error;
0
3642 -
3643 if ( j + lgc - i == (HB_Int)buffer->in_length )
never evaluated: j + lgc - i == (HB_Int)buffer->in_length
0
3644 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3645 j++; -
3646 }
never executed: }
0
3647 -
3648 error = _HB_OPEN_Coverage_Index( &lc[i], (buffer->in_string[(j)].gindex), &index ); -
3649 if ( error )
never evaluated: error
0
3650 return error;
never executed: return error;
0
3651 }
never executed: }
0
3652 -
3653 (buffer->in_string[buffer->in_pos].gindex) = rccs->Substitute[input_index]; -
3654 buffer->in_pos--; -
3655 -
3656 return error;
never executed: return error;
0
3657} -
3658HB_Error HB_GSUB_Select_Script( HB_GSUBHeader* gsub, -
3659 HB_UInt script_tag, -
3660 HB_UShort* script_index ) -
3661{ -
3662 HB_UShort n; -
3663 -
3664 HB_ScriptList* sl; -
3665 HB_ScriptRecord* sr; -
3666 -
3667 -
3668 if ( !gsub || !script_index )
partially evaluated: !gsub
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5658
partially evaluated: !script_index
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5658
0-5658
3669 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
3670 -
3671 sl = &gsub->ScriptList; -
3672 sr = sl->ScriptRecord; -
3673 -
3674 for ( n = 0; n < sl->ScriptCount; n++ )
evaluated: n < sl->ScriptCount
TRUEFALSE
yes
Evaluation Count:56643
yes
Evaluation Count:2504
2504-56643
3675 if ( script_tag == sr[n].ScriptTag )
evaluated: script_tag == sr[n].ScriptTag
TRUEFALSE
yes
Evaluation Count:3154
yes
Evaluation Count:53489
3154-53489
3676 { -
3677 *script_index = n; -
3678 -
3679 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:3154
3154
3680 } -
3681 -
3682 return HB_Err_Not_Covered;
executed: return HB_Err_Not_Covered;
Execution Count:2504
2504
3683} -
3684 -
3685 -
3686 -
3687HB_Error HB_GSUB_Select_Language( HB_GSUBHeader* gsub, -
3688 HB_UInt language_tag, -
3689 HB_UShort script_index, -
3690 HB_UShort* language_index, -
3691 HB_UShort* req_feature_index ) -
3692{ -
3693 HB_UShort n; -
3694 -
3695 HB_ScriptList* sl; -
3696 HB_ScriptRecord* sr; -
3697 HB_ScriptTable* s; -
3698 HB_LangSysRecord* lsr; -
3699 -
3700 -
3701 if ( !gsub || !language_index || !req_feature_index )
never evaluated: !gsub
never evaluated: !language_index
never evaluated: !req_feature_index
0
3702 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
3703 -
3704 sl = &gsub->ScriptList; -
3705 sr = sl->ScriptRecord; -
3706 -
3707 if ( script_index >= sl->ScriptCount )
never evaluated: script_index >= sl->ScriptCount
0
3708 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
3709 -
3710 s = &sr[script_index].Script; -
3711 lsr = s->LangSysRecord; -
3712 -
3713 for ( n = 0; n < s->LangSysCount; n++ )
never evaluated: n < s->LangSysCount
0
3714 if ( language_tag == lsr[n].LangSysTag )
never evaluated: language_tag == lsr[n].LangSysTag
0
3715 { -
3716 *language_index = n; -
3717 *req_feature_index = lsr[n].LangSys.ReqFeatureIndex; -
3718 -
3719 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
3720 } -
3721 -
3722 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3723} -
3724 -
3725 -
3726 -
3727 -
3728 -
3729 -
3730HB_Error HB_GSUB_Select_Feature( HB_GSUBHeader* gsub, -
3731 HB_UInt feature_tag, -
3732 HB_UShort script_index, -
3733 HB_UShort language_index, -
3734 HB_UShort* feature_index ) -
3735{ -
3736 HB_UShort n; -
3737 -
3738 HB_ScriptList* sl; -
3739 HB_ScriptRecord* sr; -
3740 HB_ScriptTable* s; -
3741 HB_LangSysRecord* lsr; -
3742 HB_LangSys* ls; -
3743 HB_UShort* fi; -
3744 -
3745 HB_FeatureList* fl; -
3746 HB_FeatureRecord* fr; -
3747 -
3748 -
3749 if ( !gsub || !feature_index )
partially evaluated: !gsub
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1205
partially evaluated: !feature_index
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1205
0-1205
3750 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
3751 -
3752 sl = &gsub->ScriptList; -
3753 sr = sl->ScriptRecord; -
3754 -
3755 fl = &gsub->FeatureList; -
3756 fr = fl->FeatureRecord; -
3757 -
3758 if ( script_index >= sl->ScriptCount )
partially evaluated: script_index >= sl->ScriptCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1205
0-1205
3759 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
3760 -
3761 s = &sr[script_index].Script; -
3762 lsr = s->LangSysRecord; -
3763 -
3764 if ( language_index == 0xFFFF )
partially evaluated: language_index == 0xFFFF
TRUEFALSE
yes
Evaluation Count:1205
no
Evaluation Count:0
0-1205
3765 ls = &s->DefaultLangSys;
executed: ls = &s->DefaultLangSys;
Execution Count:1205
1205
3766 else -
3767 { -
3768 if ( language_index >= s->LangSysCount )
never evaluated: language_index >= s->LangSysCount
0
3769 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
3770 -
3771 ls = &lsr[language_index].LangSys; -
3772 }
never executed: }
0
3773 -
3774 fi = ls->FeatureIndex; -
3775 -
3776 for ( n = 0; n < ls->FeatureCount; n++ )
evaluated: n < ls->FeatureCount
TRUEFALSE
yes
Evaluation Count:4521
yes
Evaluation Count:446
446-4521
3777 { -
3778 if ( fi[n] >= fl->FeatureCount )
partially evaluated: fi[n] >= fl->FeatureCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4521
0-4521
3779 return _hb_err (HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
3780 -
3781 if ( feature_tag == fr[fi[n]].FeatureTag )
evaluated: feature_tag == fr[fi[n]].FeatureTag
TRUEFALSE
yes
Evaluation Count:759
yes
Evaluation Count:3762
759-3762
3782 { -
3783 *feature_index = fi[n]; -
3784 -
3785 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:759
759
3786 } -
3787 }
executed: }
Execution Count:3762
3762
3788 -
3789 return HB_Err_Not_Covered;
executed: return HB_Err_Not_Covered;
Execution Count:446
446
3790} -
3791 -
3792 -
3793 -
3794 -
3795 -
3796HB_Error HB_GSUB_Query_Scripts( HB_GSUBHeader* gsub, -
3797 HB_UInt** script_tag_list ) -
3798{ -
3799 HB_UShort n; -
3800 HB_Error error; -
3801 HB_UInt* stl; -
3802 -
3803 HB_ScriptList* sl; -
3804 HB_ScriptRecord* sr; -
3805 -
3806 -
3807 if ( !gsub || !script_tag_list )
never evaluated: !gsub
never evaluated: !script_tag_list
0
3808 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
3809 -
3810 sl = &gsub->ScriptList; -
3811 sr = sl->ScriptRecord; -
3812 -
3813 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
3814 return error;
never executed: return error;
0
3815 -
3816 for ( n = 0; n < sl->ScriptCount; n++ )
never evaluated: n < sl->ScriptCount
0
3817 stl[n] = sr[n].ScriptTag;
never executed: stl[n] = sr[n].ScriptTag;
0
3818 stl[n] = 0; -
3819 -
3820 *script_tag_list = stl; -
3821 -
3822 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
3823} -
3824 -
3825 -
3826 -
3827HB_Error HB_GSUB_Query_Languages( HB_GSUBHeader* gsub, -
3828 HB_UShort script_index, -
3829 HB_UInt** language_tag_list ) -
3830{ -
3831 HB_UShort n; -
3832 HB_Error error; -
3833 HB_UInt* ltl; -
3834 -
3835 HB_ScriptList* sl; -
3836 HB_ScriptRecord* sr; -
3837 HB_ScriptTable* s; -
3838 HB_LangSysRecord* lsr; -
3839 -
3840 -
3841 if ( !gsub || !language_tag_list )
never evaluated: !gsub
never evaluated: !language_tag_list
0
3842 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
3843 -
3844 sl = &gsub->ScriptList; -
3845 sr = sl->ScriptRecord; -
3846 -
3847 if ( script_index >= sl->ScriptCount )
never evaluated: script_index >= sl->ScriptCount
0
3848 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
3849 -
3850 s = &sr[script_index].Script; -
3851 lsr = s->LangSysRecord; -
3852 -
3853 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
3854 return error;
never executed: return error;
0
3855 -
3856 for ( n = 0; n < s->LangSysCount; n++ )
never evaluated: n < s->LangSysCount
0
3857 ltl[n] = lsr[n].LangSysTag;
never executed: ltl[n] = lsr[n].LangSysTag;
0
3858 ltl[n] = 0; -
3859 -
3860 *language_tag_list = ltl; -
3861 -
3862 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
3863} -
3864 -
3865 -
3866 -
3867 -
3868 -
3869 -
3870HB_Error HB_GSUB_Query_Features( HB_GSUBHeader* gsub, -
3871 HB_UShort script_index, -
3872 HB_UShort language_index, -
3873 HB_UInt** feature_tag_list ) -
3874{ -
3875 HB_UShort n; -
3876 HB_Error error; -
3877 HB_UInt* ftl; -
3878 -
3879 HB_ScriptList* sl; -
3880 HB_ScriptRecord* sr; -
3881 HB_ScriptTable* s; -
3882 HB_LangSysRecord* lsr; -
3883 HB_LangSys* ls; -
3884 HB_UShort* fi; -
3885 -
3886 HB_FeatureList* fl; -
3887 HB_FeatureRecord* fr; -
3888 -
3889 -
3890 if ( !gsub || !feature_tag_list )
never evaluated: !gsub
never evaluated: !feature_tag_list
0
3891 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
3892 -
3893 sl = &gsub->ScriptList; -
3894 sr = sl->ScriptRecord; -
3895 -
3896 fl = &gsub->FeatureList; -
3897 fr = fl->FeatureRecord; -
3898 -
3899 if ( script_index >= sl->ScriptCount )
never evaluated: script_index >= sl->ScriptCount
0
3900 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
3901 -
3902 s = &sr[script_index].Script; -
3903 lsr = s->LangSysRecord; -
3904 -
3905 if ( language_index == 0xFFFF )
never evaluated: language_index == 0xFFFF
0
3906 ls = &s->DefaultLangSys;
never executed: ls = &s->DefaultLangSys;
0
3907 else -
3908 { -
3909 if ( language_index >= s->LangSysCount )
never evaluated: language_index >= s->LangSysCount
0
3910 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
3911 -
3912 ls = &lsr[language_index].LangSys; -
3913 }
never executed: }
0
3914 -
3915 fi = ls->FeatureIndex; -
3916 -
3917 if ( ( (ftl) = _hb_alloc( (ls->FeatureCount + 1)*sizeof(HB_UInt), &error ), error != 0 ) )
never evaluated: ( (ftl) = _hb_alloc( (ls->FeatureCount + 1)*sizeof(HB_UInt), &error ), error != 0 )
0
3918 return error;
never executed: return error;
0
3919 -
3920 for ( n = 0; n < ls->FeatureCount; n++ )
never evaluated: n < ls->FeatureCount
0
3921 { -
3922 if ( fi[n] >= fl->FeatureCount )
never evaluated: fi[n] >= fl->FeatureCount
0
3923 { -
3924 do { if ( (ftl) ) { _hb_free( ftl ); ftl = ((void *)0); } } while (0);
never evaluated: (ftl)
never evaluated: 0
never executed: }
never executed: }
0
3925 return _hb_err (HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
3926 } -
3927 ftl[n] = fr[fi[n]].FeatureTag; -
3928 }
never executed: }
0
3929 ftl[n] = 0; -
3930 -
3931 *feature_tag_list = ftl; -
3932 -
3933 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
3934} -
3935 -
3936 -
3937 -
3938 -
3939static HB_Error GSUB_Do_Glyph_Lookup( HB_GSUBHeader* gsub, -
3940 HB_UShort lookup_index, -
3941 HB_Buffer buffer, -
3942 HB_UShort context_length, -
3943 int nesting_level ) -
3944{ -
3945 HB_Error error = HB_Err_Not_Covered; -
3946 HB_UShort i, flags, lookup_count; -
3947 HB_Lookup* lo; -
3948 int lookup_type; -
3949 -
3950 nesting_level++; -
3951 -
3952 if ( nesting_level > 100 )
partially evaluated: nesting_level > 100
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9557590
0-9557590
3953 return _hb_err (HB_Err_Not_Covered);
never executed: return _hb_err (HB_Err_Not_Covered);
0
3954 -
3955 lookup_count = gsub->LookupList.LookupCount; -
3956 if (lookup_index >= lookup_count)
partially evaluated: lookup_index >= lookup_count
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9557590
0-9557590
3957 return error;
never executed: return error;
0
3958 -
3959 lo = &gsub->LookupList.Lookup[lookup_index]; -
3960 flags = lo->LookupFlag; -
3961 lookup_type = lo->LookupType; -
3962 -
3963 for ( i = 0; i < lo->SubTableCount; i++ )
evaluated: i < lo->SubTableCount
TRUEFALSE
yes
Evaluation Count:35789233
yes
Evaluation Count:9547481
9547481-35789233
3964 { -
3965 HB_GSUB_SubTable *st = &lo->SubTable[i].st.gsub; -
3966 -
3967 switch (lookup_type) { -
3968 case 1: -
3969 error = Lookup_SingleSubst ( gsub, st, buffer, flags, context_length, nesting_level ); break;
executed: break;
Execution Count:130
130
3970 case 2: -
3971 error = Lookup_MultipleSubst ( gsub, st, buffer, flags, context_length, nesting_level ); break;
executed: break;
Execution Count:411685
411685
3972 case 3: -
3973 error = Lookup_AlternateSubst ( gsub, st, buffer, flags, context_length, nesting_level ); break;
never executed: break;
0
3974 case 4: -
3975 error = Lookup_LigatureSubst ( gsub, st, buffer, flags, context_length, nesting_level ); break;
executed: break;
Execution Count:3316494
3316494
3976 case 5: -
3977 error = Lookup_ContextSubst ( gsub, st, buffer, flags, context_length, nesting_level ); break;
never executed: break;
0
3978 case 6: -
3979 error = Lookup_ChainContextSubst ( gsub, st, buffer, flags, context_length, nesting_level ); break;
executed: break;
Execution Count:32060924
32060924
3980 -
3981 -
3982 case 8: -
3983 error = Lookup_ReverseChainContextSubst ( gsub, st, buffer, flags, context_length, nesting_level ); break;
never executed: break;
0
3984 default: -
3985 error = HB_Err_Not_Covered; -
3986 };
never executed: }
0
3987 -
3988 -
3989 -
3990 if ( error != HB_Err_Not_Covered )
evaluated: error != HB_Err_Not_Covered
TRUEFALSE
yes
Evaluation Count:10109
yes
Evaluation Count:35779124
10109-35779124
3991 return error;
executed: return error;
Execution Count:10109
10109
3992 }
executed: }
Execution Count:35779124
35779124
3993 -
3994 return HB_Err_Not_Covered;
executed: return HB_Err_Not_Covered;
Execution Count:9547481
9547481
3995} -
3996 -
3997 -
3998 HB_Error -
3999_HB_GSUB_Load_SubTable( HB_GSUB_SubTable* st, -
4000 HB_Stream stream, -
4001 HB_UShort lookup_type ) -
4002{ -
4003 switch (lookup_type) { -
4004 case 1: return Load_SingleSubst ( st, stream );
executed: return Load_SingleSubst ( st, stream );
Execution Count:2925
2925
4005 case 2: return Load_MultipleSubst ( st, stream );
executed: return Load_MultipleSubst ( st, stream );
Execution Count:8
8
4006 case 3: return Load_AlternateSubst ( st, stream );
executed: return Load_AlternateSubst ( st, stream );
Execution Count:123
123
4007 case 4: return Load_LigatureSubst ( st, stream );
executed: return Load_LigatureSubst ( st, stream );
Execution Count:1632
1632
4008 case 5: return Load_ContextSubst ( st, stream );
never executed: return Load_ContextSubst ( st, stream );
0
4009 case 6: return Load_ChainContextSubst ( st, stream );
executed: return Load_ChainContextSubst ( st, stream );
Execution Count:1475
1475
4010 -
4011 case 8: return Load_ReverseChainContextSubst ( st, stream );
never executed: return Load_ReverseChainContextSubst ( st, stream );
0
4012 default: return _hb_err (HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
4013 }; -
4014}
never executed: }
0
4015 -
4016 -
4017 void -
4018_HB_GSUB_Free_SubTable( HB_GSUB_SubTable* st, -
4019 HB_UShort lookup_type ) -
4020{ -
4021 switch ( lookup_type ) { -
4022 case 1: Free_SingleSubst ( st ); return;
executed: return;
Execution Count:2780
2780
4023 case 2: Free_MultipleSubst ( st ); return;
executed: return;
Execution Count:8
8
4024 case 3: Free_AlternateSubst ( st ); return;
executed: return;
Execution Count:117
117
4025 case 4: Free_LigatureSubst ( st ); return;
executed: return;
Execution Count:1557
1557
4026 case 5: Free_ContextSubst ( st ); return;
never executed: return;
0
4027 case 6: Free_ChainContextSubst ( st ); return;
executed: return;
Execution Count:1402
1402
4028 -
4029 case 8: Free_ReverseChainContextSubst ( st ); return;
never executed: return;
0
4030 default: return;
never executed: return;
0
4031 }; -
4032}
never executed: }
0
4033 -
4034 -
4035 -
4036 -
4037 -
4038static HB_Error GSUB_Do_String_Lookup( HB_GSUBHeader* gsub, -
4039 HB_UShort lookup_index, -
4040 HB_Buffer buffer ) -
4041{ -
4042 HB_Error error, retError = HB_Err_Not_Covered; -
4043 -
4044 HB_UInt* properties = gsub->LookupList.Properties; -
4045 int lookup_type = gsub->LookupList.Lookup[lookup_index].LookupType; -
4046 -
4047 const int nesting_level = 0; -
4048 -
4049 const HB_UShort context_length = 0xFFFF; -
4050 -
4051 switch (lookup_type) { -
4052 -
4053 case 1: -
4054 case 2: -
4055 case 3: -
4056 case 4: -
4057 case 5: -
4058 case 6: -
4059 -
4060 -
4061 _hb_buffer_clear_output ( buffer ); -
4062 buffer->in_pos = 0; -
4063 while ( buffer->in_pos < buffer->in_length )
evaluated: buffer->in_pos < buffer->in_length
TRUEFALSE
yes
Evaluation Count:9558033
yes
Evaluation Count:744297
744297-9558033
4064 { -
4065 if ( ~(buffer->in_string[(buffer->in_pos)].properties) & properties[lookup_index] )
evaluated: ~(buffer->in_string[(buffer->in_pos)].properties) & properties[lookup_index]
TRUEFALSE
yes
Evaluation Count:9557590
yes
Evaluation Count:443
443-9557590
4066 { -
4067 error = GSUB_Do_Glyph_Lookup( gsub, lookup_index, buffer, context_length, nesting_level ); -
4068 if ( error )
evaluated: error
TRUEFALSE
yes
Evaluation Count:9547481
yes
Evaluation Count:10109
10109-9547481
4069 { -
4070 if ( error != HB_Err_Not_Covered )
partially evaluated: error != HB_Err_Not_Covered
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9547481
0-9547481
4071 return error;
never executed: return error;
0
4072 }
executed: }
Execution Count:9547481
9547481
4073 else -
4074 retError = error;
executed: retError = error;
Execution Count:10109
10109
4075 } -
4076 else -
4077 error = HB_Err_Not_Covered;
executed: error = HB_Err_Not_Covered;
Execution Count:443
443
4078 -
4079 if ( error == HB_Err_Not_Covered )
evaluated: error == HB_Err_Not_Covered
TRUEFALSE
yes
Evaluation Count:9547924
yes
Evaluation Count:10109
10109-9547924
4080 if ( ( (error = _hb_buffer_copy_output_glyph ( buffer ) ) != HB_Err_Ok ) )
partially evaluated: ( (error = _hb_buffer_copy_output_glyph ( buffer ) ) != HB_Err_Ok )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9547924
0-9547924
4081 return error;
never executed: return error;
0
4082 }
executed: }
Execution Count:9558033
9558033
4083 -
4084 -
4085 -
4086 -
4087 -
4088 if ( retError == HB_Err_Ok )
evaluated: retError == HB_Err_Ok
TRUEFALSE
yes
Evaluation Count:9970
yes
Evaluation Count:734327
9970-734327
4089 _hb_buffer_swap( buffer );
executed: _hb_buffer_swap( buffer );
Execution Count:9970
9970
4090 -
4091 return retError;
executed: return retError;
Execution Count:744297
744297
4092 -
4093 case 8: -
4094 -
4095 -
4096 buffer->in_pos = buffer->in_length - 1; -
4097 do -
4098 { -
4099 if ( ~(buffer->in_string[(buffer->in_pos)].properties) & properties[lookup_index] )
never evaluated: ~(buffer->in_string[(buffer->in_pos)].properties) & properties[lookup_index]
0
4100 { -
4101 error = GSUB_Do_Glyph_Lookup( gsub, lookup_index, buffer, context_length, nesting_level ); -
4102 if ( error )
never evaluated: error
0
4103 { -
4104 if ( error != HB_Err_Not_Covered )
never evaluated: error != HB_Err_Not_Covered
0
4105 return error;
never executed: return error;
0
4106 }
never executed: }
0
4107 else -
4108 retError = error;
never executed: retError = error;
0
4109 } -
4110 else -
4111 error = HB_Err_Not_Covered;
never executed: error = HB_Err_Not_Covered;
0
4112 -
4113 if ( error == HB_Err_Not_Covered )
never evaluated: error == HB_Err_Not_Covered
0
4114 buffer->in_pos--;
never executed: buffer->in_pos--;
0
4115 }
never executed: }
0
4116 while ((HB_Int) buffer->in_pos >= 0);
never evaluated: (HB_Int) buffer->in_pos >= 0
0
4117 -
4118 return retError;
never executed: return retError;
0
4119 -
4120 -
4121 default: -
4122 return retError;
never executed: return retError;
0
4123 }; -
4124}
never executed: }
0
4125 -
4126 -
4127HB_Error HB_GSUB_Add_Feature( HB_GSUBHeader* gsub, -
4128 HB_UShort feature_index, -
4129 HB_UInt property ) -
4130{ -
4131 HB_UShort i; -
4132 -
4133 HB_Feature feature; -
4134 HB_UInt* properties; -
4135 HB_UShort* index; -
4136 HB_UShort lookup_count; -
4137 -
4138 -
4139 -
4140 if ( !gsub ||
partially evaluated: !gsub
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:759
0-759
4141 feature_index >= gsub->FeatureList.FeatureCount ||
partially evaluated: feature_index >= gsub->FeatureList.FeatureCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:759
0-759
4142 gsub->FeatureList.ApplyCount == gsub->FeatureList.FeatureCount )
partially evaluated: gsub->FeatureList.ApplyCount == gsub->FeatureList.FeatureCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:759
0-759
4143 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
4144 -
4145 gsub->FeatureList.ApplyOrder[gsub->FeatureList.ApplyCount++] = feature_index; -
4146 -
4147 properties = gsub->LookupList.Properties; -
4148 -
4149 feature = gsub->FeatureList.FeatureRecord[feature_index].Feature; -
4150 index = feature.LookupListIndex; -
4151 lookup_count = gsub->LookupList.LookupCount; -
4152 -
4153 for ( i = 0; i < feature.LookupListCount; i++ )
evaluated: i < feature.LookupListCount
TRUEFALSE
yes
Evaluation Count:1306
yes
Evaluation Count:759
759-1306
4154 { -
4155 HB_UShort lookup_index = index[i]; -
4156 if (lookup_index < lookup_count)
partially evaluated: lookup_index < lookup_count
TRUEFALSE
yes
Evaluation Count:1306
no
Evaluation Count:0
0-1306
4157 properties[lookup_index] |= property;
executed: properties[lookup_index] |= property;
Execution Count:1306
1306
4158 }
executed: }
Execution Count:1306
1306
4159 -
4160 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:759
759
4161} -
4162 -
4163 -
4164 -
4165HB_Error HB_GSUB_Clear_Features( HB_GSUBHeader* gsub ) -
4166{ -
4167 HB_UShort i; -
4168 -
4169 HB_UInt* properties; -
4170 -
4171 -
4172 if ( !gsub )
partially evaluated: !gsub
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:460
0-460
4173 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
4174 -
4175 gsub->FeatureList.ApplyCount = 0; -
4176 -
4177 properties = gsub->LookupList.Properties; -
4178 -
4179 for ( i = 0; i < gsub->LookupList.LookupCount; i++ )
evaluated: i < gsub->LookupList.LookupCount
TRUEFALSE
yes
Evaluation Count:17584
yes
Evaluation Count:460
460-17584
4180 properties[i] = 0;
executed: properties[i] = 0;
Execution Count:17584
17584
4181 -
4182 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:460
460
4183} -
4184 -
4185 -
4186 -
4187HB_Error HB_GSUB_Register_Alternate_Function( HB_GSUBHeader* gsub, -
4188 HB_AltFunction altfunc, -
4189 void* data ) -
4190{ -
4191 if ( !gsub )
never evaluated: !gsub
0
4192 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
4193 -
4194 gsub->altfunc = altfunc; -
4195 gsub->data = data; -
4196 -
4197 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
4198} -
4199 -
4200 -
4201 -
4202 -
4203HB_Error HB_GSUB_Apply_String( HB_GSUBHeader* gsub, -
4204 HB_Buffer buffer ) -
4205{ -
4206 HB_Error error, retError = HB_Err_Not_Covered; -
4207 int i, j, lookup_count, num_features; -
4208 -
4209 if ( !gsub ||
partially evaluated: !gsub
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:248113
0-248113
4210 !buffer)
partially evaluated: !buffer
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:248113
0-248113
4211 return _hb_err (HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
4212 -
4213 if ( buffer->in_length == 0 )
partially evaluated: buffer->in_length == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:248113
0-248113
4214 return retError;
never executed: return retError;
0
4215 -
4216 lookup_count = gsub->LookupList.LookupCount; -
4217 num_features = gsub->FeatureList.ApplyCount; -
4218 -
4219 for ( i = 0; i < num_features; i++)
evaluated: i < num_features
TRUEFALSE
yes
Evaluation Count:496205
yes
Evaluation Count:248113
248113-496205
4220 { -
4221 HB_UShort feature_index = gsub->FeatureList.ApplyOrder[i]; -
4222 HB_Feature feature = gsub->FeatureList.FeatureRecord[feature_index].Feature; -
4223 -
4224 for ( j = 0; j < feature.LookupListCount; j++ )
evaluated: j < feature.LookupListCount
TRUEFALSE
yes
Evaluation Count:744297
yes
Evaluation Count:496205
496205-744297
4225 { -
4226 HB_UShort lookup_index = feature.LookupListIndex[j]; -
4227 -
4228 -
4229 if (lookup_index >= lookup_count)
partially evaluated: lookup_index >= lookup_count
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:744297
0-744297
4230 continue;
never executed: continue;
0
4231 -
4232 error = GSUB_Do_String_Lookup( gsub, lookup_index, buffer ); -
4233 if ( error )
evaluated: error
TRUEFALSE
yes
Evaluation Count:734327
yes
Evaluation Count:9970
9970-734327
4234 { -
4235 if ( error != HB_Err_Not_Covered )
partially evaluated: error != HB_Err_Not_Covered
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:734327
0-734327
4236 return error;
never executed: return error;
0
4237 }
executed: }
Execution Count:734327
734327
4238 else -
4239 retError = error;
executed: retError = error;
Execution Count:9970
9970
4240 } -
4241 }
executed: }
Execution Count:496205
496205
4242 -
4243 error = retError; -
4244 -
4245 return error;
executed: return error;
Execution Count:248113
248113
4246} -
4247 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial