From e57b51a160f9f89ac4d9bb91b8d4124f0e1bbbed Mon Sep 17 00:00:00 2001 From: Vreixo Formoso Date: Fri, 8 Feb 2008 10:31:09 +0100 Subject: [PATCH] Bug fix, read errors are now handled propertly. --- libisofs/filesrc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libisofs/filesrc.c b/libisofs/filesrc.c index 79e73f9..52564af 100644 --- a/libisofs/filesrc.c +++ b/libisofs/filesrc.c @@ -302,6 +302,10 @@ int filesrc_writer_write_data(IsoImageWriter *writer) for (b = 0; b < nblocks; ++b) { int wres; res = filesrc_read(file, buffer, BLOCK_SIZE); + if (res <= 0) { + /* read error */ + break; + } wres = iso_write(t, buffer, BLOCK_SIZE); if (wres < 0) { /* ko, writer error, we need to go out! */