From 19d486373e93f93816e3ca59d2ac346d3c4b2345 Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Mon, 19 Nov 2007 19:47:44 +0000 Subject: add a patch that fixes a bug that would give invalid premature eof errors, thanks to Daniel Pielmeier , bug #175504 (Portage version: 2.1.3.19) --- media-video/vamps/files/digest-vamps-0.99.2-r1 | 3 ++ .../vamps/files/vamps-0.99.2-premature-eof.patch | 46 ++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 media-video/vamps/files/digest-vamps-0.99.2-r1 create mode 100644 media-video/vamps/files/vamps-0.99.2-premature-eof.patch (limited to 'media-video/vamps/files') diff --git a/media-video/vamps/files/digest-vamps-0.99.2-r1 b/media-video/vamps/files/digest-vamps-0.99.2-r1 new file mode 100644 index 000000000000..2607b4916eb3 --- /dev/null +++ b/media-video/vamps/files/digest-vamps-0.99.2-r1 @@ -0,0 +1,3 @@ +MD5 7d438185a2ae95ebb245472d9fa47d06 vamps-0.99.2.tar.gz 47062 +RMD160 1b0d34ba3b583d9d35fc4cee30014c704e64a36d vamps-0.99.2.tar.gz 47062 +SHA256 9bac71441db55c04a642c786d6427efdb65aa27f4b1719ffa34ebc3869572694 vamps-0.99.2.tar.gz 47062 diff --git a/media-video/vamps/files/vamps-0.99.2-premature-eof.patch b/media-video/vamps/files/vamps-0.99.2-premature-eof.patch new file mode 100644 index 000000000000..48340498d9bc --- /dev/null +++ b/media-video/vamps/files/vamps-0.99.2-premature-eof.patch @@ -0,0 +1,46 @@ +--- vamps-0.99.2/vamps/vamps.c.orig 2006-04-15 08:00:07.000000000 -0400 ++++ vamps-0.99.2/vamps/vamps.c 2007-01-26 06:54:27.000000000 -0500 +@@ -18,6 +18,9 @@ + // + // Revision history (latest first): + // ++// 2007/01/26: V0.99.3: Fixed assumptions in lock() which do not hold for pipes. ++// This cures the "Premature EOF" problem. ++// + // 2006/04/15: V0.99.2: Fixed some signed/unsigned issues which caused compiler + // warnings on some platforms. No funtional changes. + // +@@ -396,13 +399,24 @@ + rhwp = rptr + avail; + } + +- n = read (0, rhwp, RBUF_SIZE - avail); +- +- if (n % SECT_SIZE) +- fatal ("Premature EOF"); +- +- rhwp += n; +- bytes_read += n; ++ while (avail < size) ++ { ++ // read; reads from an open pipe will return any non-zero amount of data ++ // (not necessarily the amount we wanted!) ++ n = read (0, rhwp, RBUF_SIZE - avail); ++ if (!n) ++ { ++ if (avail % SECT_SIZE) ++ // we got an EOF and only a partial sector ++ fatal ("Premature EOF"); ++ break; ++ } ++ else if (n == -1) ++ fatal ("Read from stdin: %s", strerror (errno)); ++ rhwp += n; ++ bytes_read += n; ++ avail += n; ++ } + + return !n; + } + + -- cgit v1.2.3-65-gdbad