From 0a31674b1e78930e86d4d7408082f564bc550cf7 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Tue, 4 Oct 2011 20:10:13 +0100 Subject: Establish 'break scope' within fz_try macro It is vital that no one returns from within fz_try. As such it's often necessary to jump out of an fz_try. This can mean using a label at the end of the fz_try section to goto. By introducing a "do { } while (0)" around the contents of the fz_try we allow people to 'break' (or 'continue') to get out neatly. --- pdf/pdf_image.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'pdf/pdf_image.c') diff --git a/pdf/pdf_image.c b/pdf/pdf_image.c index 1eff510a..438f4cef 100644 --- a/pdf/pdf_image.c +++ b/pdf/pdf_image.c @@ -63,7 +63,7 @@ pdf_load_image_imp(pdf_xref *xref, fz_obj *rdb, fz_obj *dict, fz_stream *cstm, i tile = mask; mask = NULL; } - goto end; + break; /* Out of fz_try */ } w = fz_to_int(fz_dict_getsa(dict, "Width", "W")); @@ -234,8 +234,6 @@ pdf_load_image_imp(pdf_xref *xref, fz_obj *rdb, fz_obj *dict, fz_stream *cstm, i { fz_decode_tile(tile, decode); } -end: - {} } fz_catch(ctx) { -- cgit v1.2.3