diff options
author | Ken Sharp <ken.sharp@artifex.com> | 2022-01-21 09:26:16 +0000 |
---|---|---|
committer | Ken Sharp <ken.sharp@artifex.com> | 2022-01-21 09:26:47 +0000 |
commit | d532bff8920534068ceab564bd7a4f7b01af440e (patch) | |
tree | 48d3818cc313ceedbad9583a2c6a0670ff9a3fa2 /pdf/pdf_doc.c | |
parent | 5fe77c896b08504dda008353129ca0df1e4a1a09 (diff) | |
download | ghostpdl-d532bff8920534068ceab564bd7a4f7b01af440e.tar.gz |
Coverity ID 374864 and 374863
Don't ignore the return value from the loop detection routines.
Diffstat (limited to 'pdf/pdf_doc.c')
-rw-r--r-- | pdf/pdf_doc.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/pdf/pdf_doc.c b/pdf/pdf_doc.c index 35be01846..91474a0cc 100644 --- a/pdf/pdf_doc.c +++ b/pdf/pdf_doc.c @@ -1061,19 +1061,25 @@ static int pdfi_doc_PageLabels(pdf_context *ctx) int code; pdf_dict *PageLabels = NULL; - if (ctx->loop_detection) + if (ctx->loop_detection) { code = pdfi_loop_detector_mark(ctx); + if (code < 0) + return code; + } code = pdfi_dict_knownget_type(ctx, ctx->Root, "PageLabels", PDF_DICT, (pdf_obj **)&PageLabels); if (code <= 0) { if (ctx->loop_detection) - code = pdfi_loop_detector_cleartomark(ctx); + (void)pdfi_loop_detector_cleartomark(ctx); /* TODO: flag a warning */ goto exit; } - if (ctx->loop_detection) + if (ctx->loop_detection) { code = pdfi_loop_detector_cleartomark(ctx); + if (code < 0) + goto exit; + } /* This will send the PageLabels object as a 'pdfpagelabels' setdeviceparams */ code = pdfi_mark_object(ctx, (pdf_obj *)PageLabels, "pdfpagelabels"); |