From e379c29f4977edfe981e93390da9a6bfa675446a Mon Sep 17 00:00:00 2001 From: Eric Smith Date: Tue, 25 Mar 2003 09:38:08 +0000 Subject: [PATCH] support both big- and little-endian TIFF files. don't crash in close_input_file() if current_input_handler is NULL. --- Makefile | 4 ++-- tumble_input.c | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 46e4ad5..cefc29d 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # tumble: build a PDF file from image files # Makefile -# $Id: Makefile,v 1.38 2003/03/20 00:20:52 eric Exp $ +# $Id: Makefile,v 1.39 2003/03/25 01:38:08 eric Exp $ # Copyright 2001, 2002, 2003 Eric Smith # # This program is free software; you can redistribute it and/or modify @@ -57,7 +57,7 @@ YFLAGS = -d -v # let me know why so I can improve this Makefile. # ----------------------------------------------------------------------------- -VERSION = 0.31 +VERSION = 0.32 PACKAGE = tumble diff --git a/tumble_input.c b/tumble_input.c index a4bdbab..bec6723 100644 --- a/tumble_input.c +++ b/tumble_input.c @@ -2,7 +2,7 @@ * tumble: build a PDF file from image files * * Input handler dispatch - * $Id: tumble_input.c,v 1.3 2003/03/20 06:55:27 eric Exp $ + * $Id: tumble_input.c,v 1.4 2003/03/25 01:38:08 eric Exp $ * Copyright 2001, 2002, 2003 Eric Smith * * This program is free software; you can redistribute it and/or modify @@ -110,9 +110,13 @@ bool open_input_file (char *name) bool close_input_file (void) { - bool result; + bool result = 1; - result = current_input_handler->close_input_file (); + if (current_input_handler) + { + result = current_input_handler->close_input_file (); + current_input_handler = NULL; + } if (in_filename) free (in_filename); if (in) @@ -127,6 +131,8 @@ bool close_input_file (void) bool last_input_page (void) { + if (! current_input_handler) + return (0); return (current_input_handler->last_input_page ()); } @@ -135,6 +141,8 @@ bool get_image_info (int image, input_attributes_t input_attributes, image_info_t *image_info) { + if (! current_input_handler) + return (0); return (current_input_handler->get_image_info (image, input_attributes, image_info)); @@ -145,6 +153,8 @@ bool process_image (int image, image_info_t *image_info, pdf_page_handle page) { + if (! current_input_handler) + return (0); return (current_input_handler->process_image (image, input_attributes, image_info,