From 7c871225996e814fe5ce513097a8eefca0b9294c Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Tue, 7 Aug 2012 18:08:41 +0100 Subject: Remove fz_too_deeply_nested. Rather than specifically checking for the nesting getting too deep and hence throwing an error, the error handling should do this for itself. Make it so that we spot the depth being too great in the fz_try() and throw to the fz_catch(). --- pdf/pdf_parse.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'pdf') diff --git a/pdf/pdf_parse.c b/pdf/pdf_parse.c index 6f27099f..dd710891 100644 --- a/pdf/pdf_parse.c +++ b/pdf/pdf_parse.c @@ -244,9 +244,6 @@ pdf_parse_array(pdf_document *xref, fz_stream *file, pdf_lexbuf *buf) break; case PDF_TOK_OPEN_ARRAY: - if (fz_too_deeply_nested(ctx)) - fz_throw(ctx, "nested too deep, not parsing array"); - obj = pdf_parse_array(xref, file, buf); pdf_array_push(ary, obj); pdf_drop_obj(obj); @@ -254,9 +251,6 @@ pdf_parse_array(pdf_document *xref, fz_stream *file, pdf_lexbuf *buf) break; case PDF_TOK_OPEN_DICT: - if (fz_too_deeply_nested(ctx)) - fz_throw(ctx, "nested too deep, not parsing dict"); - obj = pdf_parse_dict(xref, file, buf); pdf_array_push(ary, obj); pdf_drop_obj(obj); @@ -354,16 +348,10 @@ pdf_parse_dict(pdf_document *xref, fz_stream *file, pdf_lexbuf *buf) switch (tok) { case PDF_TOK_OPEN_ARRAY: - if (fz_too_deeply_nested(ctx)) - fz_throw(ctx, "nested too deep, not parsing array"); - val = pdf_parse_array(xref, file, buf); break; case PDF_TOK_OPEN_DICT: - if (fz_too_deeply_nested(ctx)) - fz_throw(ctx, "nested too deep, not parsing array"); - val = pdf_parse_dict(xref, file, buf); break; -- cgit v1.2.3