Coverage Report

Created: 2022-10-31 07:00

/src/ghostpdl/pdf/pdf_path.c
Line
Count
Source (jump to first uncovered line)
1
/* Copyright (C) 2018-2022 Artifex Software, Inc.
2
   All Rights Reserved.
3
4
   This software is provided AS-IS with no warranty, either express or
5
   implied.
6
7
   This software is distributed under license and may not be copied,
8
   modified or distributed except as expressly authorized under the terms
9
   of the license contained in the file LICENSE in this distribution.
10
11
   Refer to licensing information at http://www.artifex.com or contact
12
   Artifex Software, Inc.,  1305 Grant Avenue - Suite 200, Novato,
13
   CA 94945, U.S.A., +1(415)492-9861, for further information.
14
*/
15
16
/* Path operations for the PDF interpreter */
17
18
#include "pdf_int.h"
19
#include "pdf_font_types.h"
20
#include "pdf_gstate.h"
21
#include "pdf_path.h"
22
#include "pdf_stack.h"
23
#include "pdf_trans.h"
24
#include "gstypes.h"
25
#include "pdf_optcontent.h"
26
#include "gspath.h"         /* For gs_moveto() and friends */
27
#include "gspaint.h"        /* For gs_fill() and friends */
28
29
typedef enum path_segment_e {
30
    pdfi_moveto_seg,
31
    pdfi_lineto_seg,
32
    pdfi_curveto_seg,
33
    pdfi_re_seg,
34
    pdfi_v_curveto_seg,
35
    pdfi_y_curveto_seg,
36
    pdfi_closepath_seg
37
} pdfi_path_segment;
38
39
static int StorePathSegment(pdf_context *ctx, pdfi_path_segment segment, double *pts)
40
23.2M
{
41
23.2M
    int size = 0;
42
43
23.2M
    switch (segment)
44
23.2M
    {
45
2.29M
        case pdfi_moveto_seg:
46
10.1M
        case pdfi_lineto_seg:
47
10.1M
            size = 2;
48
10.1M
            break;
49
1.68M
        case pdfi_re_seg:
50
1.83M
        case pdfi_v_curveto_seg:
51
1.99M
        case pdfi_y_curveto_seg:
52
1.99M
            size = 4;
53
1.99M
                break;
54
10.9M
        case pdfi_curveto_seg:
55
10.9M
            size = 6;
56
10.9M
            break;
57
179k
        case pdfi_closepath_seg:
58
179k
            break;
59
0
        default:
60
0
            return_error(gs_error_undefined);
61
0
            break;
62
23.2M
    }
63
23.2M
    if (ctx->PathSegments == NULL) {
64
2.96M
        ctx->PathSegments = (char *)gs_alloc_bytes(ctx->memory, 1024, "StorePathSegment");
65
2.96M
        if (ctx->PathSegments == NULL)
66
0
            return_error(gs_error_VMerror);
67
2.96M
        ctx->PathSegmentsCurrent = ctx->PathSegments;
68
2.96M
        ctx->PathSegmentsTop = ctx->PathSegments + 1024;
69
2.96M
    }
70
23.2M
    if (ctx->PathSegmentsCurrent == ctx->PathSegmentsTop) {
71
458
        char *new_accumulator = NULL;
72
458
        uint64_t old_size;
73
74
458
        old_size = ctx->PathSegmentsCurrent - ctx->PathSegments;
75
458
        new_accumulator = (char *)gs_alloc_bytes(ctx->memory, old_size + 1024, "StorePathSegment");
76
458
        if (new_accumulator == NULL)
77
0
            return_error(gs_error_VMerror);
78
458
        memcpy(new_accumulator, ctx->PathSegments, old_size);
79
458
        ctx->PathSegmentsCurrent = new_accumulator + old_size;
80
458
        gs_free_object(ctx->memory, ctx->PathSegments, "StorePathSegment");
81
458
        ctx->PathSegments = new_accumulator;
82
458
        ctx->PathSegmentsTop = ctx->PathSegments + old_size + 1024;
83
458
    }
84
85
23.2M
    if (ctx->PathPts == NULL) {
86
2.96M
        ctx->PathPts = (double *)gs_alloc_bytes(ctx->memory, 4096, "StorePathSegment");
87
2.96M
        if (ctx->PathPts == NULL)
88
0
            return_error(gs_error_VMerror);
89
2.96M
        ctx->PathPtsCurrent = ctx->PathPts;
90
2.96M
        ctx->PathPtsTop = ctx->PathPts + (4096 / sizeof(double));
91
2.96M
    }
92
23.2M
    if (ctx->PathPtsCurrent + size > ctx->PathPtsTop) {
93
26.7k
        double *new_accumulator = NULL;
94
26.7k
        uint64_t old_size;
95
96
26.7k
        old_size = (char *)ctx->PathPtsCurrent - (char *)ctx->PathPts;
97
26.7k
        new_accumulator = (double *)gs_alloc_bytes(ctx->memory, old_size + 4096, "StorePathSegment");
98
26.7k
        if (new_accumulator == NULL)
99
0
            return_error(gs_error_VMerror);
100
26.7k
        memcpy(new_accumulator, ctx->PathPts, old_size);
101
26.7k
        ctx->PathPtsCurrent = new_accumulator + (old_size / sizeof(double));
102
26.7k
        gs_free_object(ctx->memory, ctx->PathPts, "StorePathSegment");
103
26.7k
        ctx->PathPts = new_accumulator;
104
26.7k
        ctx->PathPtsTop = ctx->PathPts + ((old_size + 4096) / sizeof(double));
105
26.7k
    }
106
107
23.2M
    *(ctx->PathSegmentsCurrent++) = (char)segment;
108
23.2M
    switch (segment)
109
23.2M
    {
110
2.29M
        case pdfi_moveto_seg:
111
10.1M
        case pdfi_lineto_seg:
112
10.1M
            memcpy(ctx->PathPtsCurrent, pts, 2 * sizeof(double));
113
10.1M
            ctx->PathPtsCurrent += 2;
114
10.1M
            break;
115
1.68M
        case pdfi_re_seg:
116
1.83M
        case pdfi_v_curveto_seg:
117
1.99M
        case pdfi_y_curveto_seg:
118
1.99M
            memcpy(ctx->PathPtsCurrent, pts, 4 * sizeof(double));
119
1.99M
            ctx->PathPtsCurrent += 4;
120
1.99M
            break;
121
10.9M
        case pdfi_curveto_seg:
122
10.9M
            memcpy(ctx->PathPtsCurrent, pts, 6 * sizeof(double));
123
10.9M
            ctx->PathPtsCurrent += 6;
124
10.9M
            break;
125
179k
        case pdfi_closepath_seg:
126
179k
            break;
127
23.2M
    }
128
23.2M
    return 0;
129
23.2M
}
130
131
static int ApplyStoredPath(pdf_context *ctx)
132
3.06M
{
133
3.06M
    int code = 0;
134
3.06M
    char *op = NULL;
135
3.06M
    double *dpts = NULL;
136
3.06M
    double *current;
137
138
3.06M
    if (ctx->PathSegments == NULL)
139
117k
        return 0;
140
141
2.94M
    if (ctx->PathPts == NULL) {
142
0
        code = gs_note_error(gs_error_unknownerror);
143
0
        goto error;
144
0
    }
145
146
2.94M
    if (ctx->pgs->current_point_valid) {
147
6.66k
        code = gs_newpath(ctx->pgs);
148
6.66k
        if (code < 0)
149
2
            goto error;
150
6.66k
    }
151
152
2.94M
    op = ctx->PathSegments;
153
2.94M
    dpts = ctx->PathPts;
154
2.94M
    current = dpts; /* Stop stupid compilers complaining. */
155
156
25.8M
    while (op < ctx->PathSegmentsCurrent) {
157
22.9M
        if (dpts > ctx->PathPtsCurrent) {
158
0
            code = gs_note_error(gs_error_unknownerror);
159
0
            goto error;
160
0
        }
161
162
22.9M
        switch(*op++) {
163
2.24M
            case pdfi_moveto_seg:
164
2.24M
                code = gs_moveto(ctx->pgs, dpts[0], dpts[1]);
165
2.24M
                current = dpts;
166
2.24M
                dpts+= 2;
167
2.24M
                break;
168
7.71M
            case pdfi_lineto_seg:
169
7.71M
                code = gs_lineto(ctx->pgs, dpts[0], dpts[1]);
170
7.71M
                current = dpts;
171
7.71M
                dpts+= 2;
172
7.71M
                break;
173
1.66M
            case pdfi_re_seg:
174
1.66M
                code = gs_moveto(ctx->pgs, dpts[0], dpts[1]);
175
1.66M
                if (code >= 0) {
176
1.66M
                    code = gs_rlineto(ctx->pgs, dpts[2], 0);
177
1.66M
                    if (code >= 0) {
178
1.66M
                        code = gs_rlineto(ctx->pgs, 0, dpts[3]);
179
1.66M
                        if (code >= 0) {
180
1.66M
                            code = gs_rlineto(ctx->pgs, -dpts[2], 0);
181
1.66M
                            if (code >= 0)
182
1.66M
                                code = gs_closepath(ctx->pgs);
183
1.66M
                        }
184
1.66M
                    }
185
1.66M
                }
186
1.66M
                current = dpts;
187
1.66M
                dpts+= 4;
188
1.66M
                break;
189
148k
            case pdfi_v_curveto_seg:
190
148k
                code = gs_curveto(ctx->pgs, current[0], current[1], dpts[0], dpts[1], dpts[2], dpts[3]);
191
148k
                current = dpts + 2;
192
148k
                dpts+= 4;
193
148k
                break;
194
158k
            case pdfi_y_curveto_seg:
195
158k
                code = gs_curveto(ctx->pgs, dpts[0], dpts[1], dpts[2], dpts[3], dpts[2], dpts[3]);
196
158k
                current = dpts + 2;
197
158k
                dpts+= 4;
198
158k
                break;
199
10.7M
            case pdfi_curveto_seg:
200
10.7M
                code = gs_curveto(ctx->pgs, dpts[0], dpts[1], dpts[2], dpts[3], dpts[4], dpts[5]);
201
10.7M
                current = dpts + 4;
202
10.7M
                dpts+= 6;
203
10.7M
                break;
204
175k
            case pdfi_closepath_seg:
205
175k
                code = gs_closepath(ctx->pgs);
206
175k
                break;
207
0
            default:
208
0
                code = gs_note_error(gs_error_rangecheck);
209
0
                break;
210
22.9M
        }
211
22.9M
        if (code < 0)
212
30.9k
            break;
213
22.9M
    }
214
215
2.94M
error:
216
2.94M
    gs_free_object(ctx->memory, ctx->PathSegments, "ApplyStoredPath");
217
2.94M
    ctx->PathSegmentsTop = ctx->PathSegmentsCurrent = ctx->PathSegments = NULL;
218
2.94M
    gs_free_object(ctx->memory, ctx->PathPts, "ApplyStoredPath");
219
2.94M
    ctx->PathPtsTop = ctx->PathPtsCurrent = ctx->PathPts = NULL;
220
2.94M
    return code;
221
2.94M
}
222
223
int pdfi_moveto (pdf_context *ctx)
224
2.38M
{
225
2.38M
    int code;
226
2.38M
    double xy[2];
227
228
2.38M
    if (ctx->text.BlockDepth != 0)
229
78.6k
        pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_moveto", NULL);
230
231
2.38M
    code = pdfi_destack_reals(ctx, xy, 2);
232
2.38M
    if (code < 0)
233
89.6k
        return code;
234
235
2.29M
    return StorePathSegment(ctx, pdfi_moveto_seg, (double *)&xy);
236
2.38M
}
237
238
int pdfi_lineto (pdf_context *ctx)
239
8.01M
{
240
8.01M
    int code;
241
8.01M
    double xy[2];
242
243
8.01M
    if (ctx->text.BlockDepth != 0)
244
133k
        pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_lineto", NULL);
245
246
8.01M
    code = pdfi_destack_reals(ctx, xy, 2);
247
8.01M
    if (code < 0)
248
112k
        return code;
249
250
7.90M
    return StorePathSegment(ctx, pdfi_lineto_seg, (double *)&xy);
251
8.01M
}
252
253
static int pdfi_fill_inner(pdf_context *ctx, bool use_eofill)
254
1.98M
{
255
1.98M
    int code=0, code1;
256
1.98M
    pdfi_trans_state_t state;
257
258
1.98M
    if (ctx->text.BlockDepth != 0)
259
73.1k
        pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_fill_inner", NULL);
260
261
1.98M
    if (pdfi_oc_is_off(ctx))
262
17.0k
        goto exit;
263
264
1.96M
    code = ApplyStoredPath(ctx);
265
1.96M
    if (code < 0)
266
10.3k
        return code;
267
268
1.95M
    code = pdfi_trans_setup(ctx, &state, NULL, TRANSPARENCY_Caller_Fill);
269
1.95M
    if (code == 0) {
270
        /* If we don't gsave/grestore round the fill, then the file
271
         * /tests_private/pdf/sumatra/954_-_dashed_lines_hardly_visible.pdf renders
272
         * incorrectly. However we must not gsave/grestore round the trans_setup
273
         * trans_teardown, because that might set pgs->soft_mask_id and if we restore
274
         * back to a point where that is not set then pdfwrite doesn't work properly.
275
         */
276
1.95M
        code = pdfi_gsave(ctx);
277
1.95M
        if (code < 0) goto exit;
278
279
1.95M
        if (use_eofill)
280
21.9k
            code = gs_eofill(ctx->pgs);
281
1.93M
        else
282
1.93M
            code = gs_fill(ctx->pgs);
283
1.95M
        code1 = pdfi_grestore(ctx);
284
1.95M
        if (code == 0) code = code1;
285
286
1.95M
        code1 = pdfi_trans_teardown(ctx, &state);
287
1.95M
        if (code == 0) code = code1;
288
1.95M
    }
289
290
1.97M
 exit:
291
1.97M
    code1 = pdfi_newpath(ctx);
292
1.97M
    if (code == 0) code = code1;
293
294
1.97M
    return code;
295
1.95M
}
296
297
int pdfi_fill(pdf_context *ctx)
298
1.95M
{
299
1.95M
    return pdfi_fill_inner(ctx, false);
300
1.95M
}
301
302
int pdfi_eofill(pdf_context *ctx)
303
22.7k
{
304
22.7k
    return pdfi_fill_inner(ctx, true);
305
22.7k
}
306
307
int pdfi_stroke(pdf_context *ctx)
308
821k
{
309
821k
    int code=0, code1;
310
821k
    pdfi_trans_state_t state;
311
312
821k
    if (ctx->text.BlockDepth != 0)
313
97.8k
        pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_stroke", NULL);
314
315
821k
    if (pdfi_oc_is_off(ctx))
316
9
        goto exit;
317
318
821k
    code = ApplyStoredPath(ctx);
319
821k
    if (code < 0)
320
7.64k
        return code;
321
322
813k
    gs_swapcolors_quick(ctx->pgs);
323
813k
    code = pdfi_trans_setup(ctx, &state, NULL, TRANSPARENCY_Caller_Stroke);
324
813k
    if (code == 0) {
325
813k
        code = pdfi_gsave(ctx);
326
813k
        if (code < 0) goto exit;
327
328
813k
        code = gs_stroke(ctx->pgs);
329
330
813k
        code1 = pdfi_grestore(ctx);
331
813k
        if (code == 0) code = code1;
332
333
813k
        code1 = pdfi_trans_teardown(ctx, &state);
334
813k
        if (code == 0) code = code1;
335
813k
    }
336
813k
    gs_swapcolors_quick(ctx->pgs);
337
338
813k
 exit:
339
813k
    code1 = pdfi_newpath(ctx);
340
813k
    if (code == 0) code = code1;
341
342
813k
    return code;
343
813k
}
344
345
int pdfi_closepath_stroke(pdf_context *ctx)
346
40.4k
{
347
40.4k
    int code;
348
349
40.4k
    if (ctx->text.BlockDepth != 0)
350
5.27k
        pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_closepath_stroke", NULL);
351
352
40.4k
    code = StorePathSegment(ctx, pdfi_closepath_seg, NULL);
353
40.4k
    if (code < 0)
354
0
        return code;
355
356
40.4k
    return pdfi_stroke(ctx);
357
40.4k
}
358
359
int pdfi_curveto(pdf_context *ctx)
360
11.2M
{
361
11.2M
    int code;
362
11.2M
    double Values[6];
363
364
11.2M
    code = pdfi_destack_reals(ctx, Values, 6);
365
11.2M
    if (code < 0)
366
302k
        return code;
367
368
10.9M
    if (ctx->text.BlockDepth != 0)
369
83.5k
        pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_curveto", NULL);
370
371
10.9M
    return StorePathSegment(ctx, pdfi_curveto_seg, (double *)&Values);
372
11.2M
}
373
374
int pdfi_v_curveto(pdf_context *ctx)
375
150k
{
376
150k
    int code;
377
150k
    double Values[4];
378
379
150k
    code = pdfi_destack_reals(ctx, Values, 4);
380
150k
    if (code < 0)
381
1.60k
        return code;
382
383
149k
    if (ctx->text.BlockDepth != 0)
384
5
        pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_v_curveto", NULL);
385
386
149k
    return StorePathSegment(ctx, pdfi_v_curveto_seg, (double *)&Values);
387
150k
}
388
389
int pdfi_y_curveto(pdf_context *ctx)
390
160k
{
391
160k
    int code;
392
160k
    double Values[4];
393
394
160k
    code = pdfi_destack_reals(ctx, Values, 4);
395
160k
    if (code < 0)
396
1.52k
        return code;
397
398
158k
    if (ctx->text.BlockDepth != 0)
399
4
        pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_y_curveto", NULL);
400
401
158k
    return StorePathSegment(ctx, pdfi_y_curveto_seg, (double *)&Values);
402
160k
}
403
404
int pdfi_closepath(pdf_context *ctx)
405
130k
{
406
130k
    if (ctx->text.BlockDepth != 0)
407
32.2k
        pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_closepath", NULL);
408
409
130k
    return StorePathSegment(ctx, pdfi_closepath_seg, NULL);
410
130k
}
411
412
int pdfi_newpath(pdf_context *ctx)
413
3.12M
{
414
3.12M
    int code = 0, code1;
415
416
    /* This code is to deal with the wacky W and W* operators */
417
3.12M
    if (ctx->clip_active) {
418
273k
        if (ctx->PathSegments != NULL) {
419
258k
            code = ApplyStoredPath(ctx);
420
258k
            if (code < 0)
421
12.4k
                return code;
422
258k
        }
423
261k
        if (ctx->pgs->current_point_valid) {
424
247k
            if (ctx->do_eoclip)
425
10.3k
                code = gs_eoclip(ctx->pgs);
426
237k
            else
427
237k
                code = gs_clip(ctx->pgs);
428
247k
        }
429
261k
    }
430
3.10M
    ctx->clip_active = false;
431
432
3.10M
    if (ctx->PathSegments != NULL){
433
19.4k
        gs_free_object(ctx->memory, ctx->PathSegments, "ApplyStoredPath");
434
19.4k
        ctx->PathSegmentsTop = ctx->PathSegmentsCurrent = ctx->PathSegments = NULL;
435
19.4k
        gs_free_object(ctx->memory, ctx->PathPts, "ApplyStoredPath");
436
19.4k
        ctx->PathPtsTop = ctx->PathPtsCurrent = ctx->PathPts = NULL;
437
19.4k
    }
438
439
3.10M
    code1 = gs_newpath(ctx->pgs);
440
3.10M
    if (code == 0) code = code1;
441
442
3.10M
    if (ctx->text.BlockDepth != 0)
443
193k
        pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_newpath", NULL);
444
445
3.10M
    return code;
446
3.12M
}
447
448
int pdfi_b(pdf_context *ctx)
449
8.32k
{
450
8.32k
    int code;
451
452
8.32k
    if (ctx->text.BlockDepth != 0)
453
615
        pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_b", NULL);
454
455
8.32k
    code = StorePathSegment(ctx, pdfi_closepath_seg, NULL);
456
8.32k
    if (code < 0)
457
0
        return code;
458
459
8.32k
    return pdfi_B(ctx);
460
8.32k
}
461
462
int pdfi_b_star(pdf_context *ctx)
463
134
{
464
134
    int code;
465
466
134
    if (ctx->text.BlockDepth != 0)
467
0
        pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_b_star", NULL);
468
469
134
    code = StorePathSegment(ctx, pdfi_closepath_seg, NULL);
470
134
    if (code < 0)
471
0
        return code;
472
473
134
    return pdfi_B_star(ctx);
474
134
}
475
476
/* common code for B and B* */
477
static int pdfi_B_inner(pdf_context *ctx, bool use_eofill)
478
17.2k
{
479
17.2k
    int code=0, code1=0;
480
17.2k
    pdfi_trans_state_t state;
481
482
17.2k
    if (ctx->text.BlockDepth != 0)
483
3.00k
        pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_B_inner", NULL);
484
485
17.2k
    if (pdfi_oc_is_off(ctx))
486
4
        goto exit;
487
488
17.2k
    code = ApplyStoredPath(ctx);
489
17.2k
    if (code < 0)
490
560
        return code;
491
492
16.6k
    code = pdfi_trans_setup(ctx, &state, NULL, TRANSPARENCY_Caller_FillStroke);
493
16.6k
    if (code == 0) {
494
16.6k
        code = pdfi_gsave(ctx);
495
16.6k
        if (code < 0) goto exit;
496
497
16.6k
        if (use_eofill)
498
377
            code = gs_eofillstroke(ctx->pgs, &code1);
499
16.2k
        else
500
16.2k
            code = gs_fillstroke(ctx->pgs, &code1);
501
502
16.6k
        code1 = pdfi_grestore(ctx);
503
16.6k
        if (code == 0) code = code1;
504
505
16.6k
        code1 = pdfi_trans_teardown(ctx, &state);
506
16.6k
        if (code >= 0) code = code1;
507
16.6k
    }
508
509
16.6k
 exit:
510
16.6k
    code1 = pdfi_newpath(ctx);
511
16.6k
    if (code == 0) code = code1;
512
513
16.6k
    return code;
514
16.6k
}
515
516
int pdfi_B(pdf_context *ctx)
517
16.8k
{
518
16.8k
    return pdfi_B_inner(ctx, false);
519
16.8k
}
520
521
int pdfi_B_star(pdf_context *ctx)
522
387
{
523
387
    return pdfi_B_inner(ctx, true);
524
387
}
525
526
int pdfi_clip(pdf_context *ctx)
527
0
{
528
0
    int code = gs_clip(ctx->pgs);
529
530
0
    if (ctx->text.BlockDepth != 0)
531
0
        pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_B_clip", NULL);
532
533
0
    return code;
534
0
}
535
536
int pdfi_eoclip(pdf_context *ctx)
537
0
{
538
0
    int code = gs_eoclip(ctx->pgs);
539
540
0
    if (ctx->text.BlockDepth != 0)
541
0
        pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_eoclip", NULL);
542
543
0
     return code;
544
0
}
545
546
int pdfi_rectpath(pdf_context *ctx)
547
1.75M
{
548
1.75M
    int code;
549
1.75M
    double Values[4];
550
551
1.75M
    code = pdfi_destack_reals(ctx, Values, 4);
552
1.75M
    if (code < 0)
553
62.8k
        return code;
554
555
1.68M
    if (ctx->text.BlockDepth != 0)
556
128k
        pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_rectpath", NULL);
557
558
1.68M
    return StorePathSegment(ctx, pdfi_re_seg, (double *)&Values);
559
1.75M
}