Thu, 20 Mar 2003 07:02:28 +0000
fix multiple close of input file.
tumble_input.c | file | annotate | diff | revisions | |
tumble_tiff.c | file | annotate | diff | revisions |
1.1 --- a/tumble_input.c Thu Mar 20 06:54:08 2003 +0000 1.2 +++ b/tumble_input.c Thu Mar 20 07:02:28 2003 +0000 1.3 @@ -2,7 +2,7 @@ 1.4 * tumble: build a PDF file from image files 1.5 * 1.6 * Input handler dispatch 1.7 - * $Id: tumble_input.c,v 1.1 2003/03/19 22:54:08 eric Exp $ 1.8 + * $Id: tumble_input.c,v 1.2 2003/03/19 23:02:28 eric Exp $ 1.9 * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com> 1.10 * 1.11 * This program is free software; you can redistribute it and/or modify 1.12 @@ -106,8 +106,11 @@ 1.13 result = current_input_handler->close_input_file (); 1.14 if (in_filename) 1.15 free (in_filename); 1.16 - fclose (in); 1.17 - in = NULL; 1.18 + if (in) 1.19 + { 1.20 + fclose (in); 1.21 + in = NULL; 1.22 + } 1.23 1.24 return (result); 1.25 }
2.1 --- a/tumble_tiff.c Thu Mar 20 06:54:08 2003 +0000 2.2 +++ b/tumble_tiff.c Thu Mar 20 07:02:28 2003 +0000 2.3 @@ -1,7 +1,7 @@ 2.4 /* 2.5 * tumble: build a PDF file from image files 2.6 * 2.7 - * $Id: tumble_tiff.c,v 1.1 2003/03/19 22:54:08 eric Exp $ 2.8 + * $Id: tumble_tiff.c,v 1.2 2003/03/19 23:02:28 eric Exp $ 2.9 * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com> 2.10 * 2.11 * This program is free software; you can redistribute it and/or modify 2.12 @@ -65,8 +65,6 @@ 2.13 if ((buf [0] != 0x49) || (buf [1] != 0x49)) 2.14 return (0); 2.15 2.16 - /* $$$ should we dup the file descriptor here, so that later closing f 2.17 - won't cause problems? */ 2.18 tiff_in = TIFFFdOpen (fileno (f), name, "r"); 2.19 if (! tiff_in) 2.20 {