[vorbis-tools] 02/02: oggdec: Write to stdout instead of "-.wav" when reading from stdin and not output file name is given.

Martin Steghöfer martin.steghoefer-guest at moszumanska.debian.org
Thu Oct 8 19:40:16 UTC 2015


This is an automated email from the git hooks/post-receive script.

martin.steghoefer-guest pushed a commit to branch master
in repository vorbis-tools.

commit dcee2a271002d16223ade60c2be4f31a063a4670
Author: Martin Steghöfer <martin at steghoefer.eu>
Date:   Thu Oct 8 21:30:44 2015 +0200

    oggdec: Write to stdout instead of "-.wav" when reading from stdin and not output file name is given.
    
    Closes: #263762
---
 ...e-to-stdout-instead-of-.wav-when-reading-.patch | 66 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 2 files changed, 67 insertions(+)

diff --git a/debian/patches/0017-oggdec-Write-to-stdout-instead-of-.wav-when-reading-.patch b/debian/patches/0017-oggdec-Write-to-stdout-instead-of-.wav-when-reading-.patch
new file mode 100644
index 0000000..62fd3ba
--- /dev/null
+++ b/debian/patches/0017-oggdec-Write-to-stdout-instead-of-.wav-when-reading-.patch
@@ -0,0 +1,66 @@
+From: =?utf-8?q?Martin_Stegh=C3=B6fer?= <martin at steghoefer.eu>
+Date: Thu, 8 Oct 2015 21:29:45 +0200
+Subject: oggdec: Write to stdout instead of "-.wav" when reading from stdin
+ and not output file name is given.
+
+In bug #263762 it was reported that the behavior of oggdec was inconsistent
+with its documentation: According to the man page, "oggdec" should write to
+stdout, when reading its input from stdin and no output file name is given.
+The "oggdec" executable writes to "-.wav" instead.
+
+I adjusted the behavior of "oggdec" instead of adjusting the documentation
+because it seems more sensible to write to stdout than to write to a file
+called "-.wav". The code changes themselves are simple enough to be
+self-explanatory.
+
+Bug-Debian: https://bugs.debian.org/263762
+Forwarded: https://trac.xiph.org/ticket/1678#comment:1
+---
+ oggdec/oggdec.c | 27 ++++++++++++++++-----------
+ 1 file changed, 16 insertions(+), 11 deletions(-)
+
+diff --git a/oggdec/oggdec.c b/oggdec/oggdec.c
+index 3f2ae7b..84047de 100644
+--- a/oggdec/oggdec.c
++++ b/oggdec/oggdec.c
+@@ -443,16 +443,21 @@ int main(int argc, char **argv)
+                     out = outfilename;
+             }
+             else {
+-                char *end = strrchr(argv[i], '.');
+-                end = end?end:(argv[i] + strlen(argv[i]) + 1);
+-
+-                out = malloc(strlen(argv[i]) + 10);
+-                strncpy(out, argv[i], end-argv[i]);
+-                out[end-argv[i]] = 0;
+-                if(raw)
+-                    strcat(out, ".raw");
+-                else
+-                    strcat(out, ".wav");
++                if(!strcmp(argv[i], "-")) {
++                    out = NULL;
++                }
++                else {
++                    char *end = strrchr(argv[i], '.');
++                    end = end?end:(argv[i] + strlen(argv[i]) + 1);
++
++                    out = malloc(strlen(argv[i]) + 10);
++                    strncpy(out, argv[i], end-argv[i]);
++                    out[end-argv[i]] = 0;
++                    if(raw)
++                        strcat(out, ".raw");
++                    else
++                        strcat(out, ".wav");
++                }
+             }
+ 
+             infile = open_input(in);
+@@ -469,7 +474,7 @@ int main(int argc, char **argv)
+                 return 1;
+             }
+ 
+-            if(!outfilename)
++            if(!outfilename && out)
+                 free(out);
+ 
+             fclose(outfile);
diff --git a/debian/patches/series b/debian/patches/series
index dfc7006..f17c4f6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -14,3 +14,4 @@
 0014-Use-translations-in-oggdec.patch
 0015-oggenc-Fix-large-alloca-on-bad-AIFF-input-CVE-2015-6.patch
 0016-oggenc-validate-count-of-channels-in-the-header-CVE-.patch
+0017-oggdec-Write-to-stdout-instead-of-.wav-when-reading-.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-xiph/vorbis-tools.git



More information about the pkg-xiph-commits mailing list