OSDN Git Service

Don't seek inputfile when it is NULL.
authorYing-Chun Liu (PaulLiu) <paulliu@debian.org>
Tue, 4 Jun 2013 15:51:58 +0000 (23:51 +0800)
committerYing-Chun Liu (PaulLiu) <paulliu@debian.org>
Tue, 4 Jun 2013 15:51:58 +0000 (23:51 +0800)
src/wfd.c

index 628573e..f4bc752 100644 (file)
--- a/src/wfd.c
+++ b/src/wfd.c
@@ -126,7 +126,9 @@ int wfd_append(const char *outputfilename, const char *inputfilename,
 
   /* handle offset */
   if (wfd_ms2samples(offset)>0) {
-    sf_seek(inputfile,wfd_ms2samples(offset),SEEK_SET);
+    if (inputfile) {
+      sf_seek(inputfile,wfd_ms2samples(offset),SEEK_SET);
+    }
   }
 
   /* pre-calculate volume */