dvdauthor-users@lists.sourceforge.net.

View: New views
5 Messages — Rating Filter:   Alert me  

dvdauthor-users@lists.sourceforge.net.

by Andreas Falch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi folks,

It seems there is no file existence check on -x argument in dvdcli.c.  This causes

Segmentation fault when a non-existing file is given as argument:

# dvdauthor-0.6.14.tar.gz compiled on Linux 2.6.28-15-generic
# #49-Ubuntu SMP Tue Aug 18 18:40:08 UTC 2009 i686 GNU/Linux, gcc
# version 4.3.3 (Ubuntu 4.3.3-5ubuntu4

~/download/dvdauthor/dvdauthor-0.6.14$ ./src/dvdauthor -x nosuchfile.xml
DVDAuthor::dvdauthor, version 0.6.14.
Build options: gnugetopt iconv freetype
Send bugs to

Segmentation fault
~/download/dvdauthor/dvdauthor-0.6.14$

# Apply attached patch

~/download/dvdauthor/dvdauthor-0.6.14$ ./src/dvdauthor -x nosuchfile.xml
DVDAuthor::dvdauthor, version 0.6.14.
Build options: gnugetopt iconv freetype
Send bugs to

ERR:  File not found 'nosuchfile.xml'
~/download/dvdauthor/dvdauthor-0.6.14$

I'm not fluent in C so I take no offence if the another approach for checking file existence is used instead of the one used here.

Best regards,
Andreas
--


_________________________________________________________________
Show them the way! Add maps and directions to your party invites.
http://www.microsoft.com/windows/windowslive/products/events.aspx

diff --git a/src/dvdcli.c b/src/dvdcli.c
index 4ec2d4c..d379a89 100644
--- a/src/dvdcli.c
+++ b/src/dvdcli.c
@@ -24,6 +24,7 @@
 #include <assert.h>
 #include <ctype.h>
 #include <fcntl.h>
+#include <sys/stat.h>
 
 #include "conffile.h"
 #include "dvdauthor.h"
@@ -34,6 +35,7 @@
 #define RGB2YCrCb(R,G,B) ((((int)RGB2Y(R,G,B))<<16)|(((int)RGB2Cr(R,G,B))<<8)|(((int)RGB2Cb(R,G,B))))
 
 static int readdvdauthorxml(const char *xmlfile,char *fb);
+static int file_exists (char * fileName);
 
 static int hadchapter=0,pauselen=0,writeoutput=1;
 static char *chapters=0;
@@ -372,6 +374,7 @@ int main(int argc,char **argv)
             usage();
             break;
 
+ // must check file existence
         case 'x':
             if( usedtocflag ) {
                 fprintf(stderr,"ERR:  Cannot specify XML config file after using command line options\n");
@@ -1151,5 +1154,22 @@ static struct elemattr attrs[]={
 static int readdvdauthorxml(const char *xmlfile,char *fb)
 {
     fbase=fb;
+    if (file_exists(xmlfile) == 0)
+      {
+        fprintf(stderr,"ERR:  File not found '%s'\n",xmlfile);
+        return 1;
+      }
     return readxml(xmlfile,elems,attrs);
 }
+
+static int file_exists (char * fileName)
+{
+ struct stat buf;
+ int i = stat ( fileName, &buf );
+ /* File found */
+  if ( i == 0 )
+    {
+      return 1;
+    }
+  return 0;
+}


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Dvdauthor-users mailing list
Dvdauthor-users@...
https://lists.sourceforge.net/lists/listinfo/dvdauthor-users

Re: dvdauthor-users@lists.sourceforge.net.

by Lawrence D'Oliveiro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Andreas Falch wrote:

> It seems there is no file existence check on -x argument in dvdcli.c.  This causes
> Segmentation fault when a non-existing file is given as argument:

Yeah
<http://sourceforge.net/mailarchive/message.php?msg_name=78jvum%241d4grh%40smtp.mailfilter6.ihug.co.nz>.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Dvdauthor-users mailing list
Dvdauthor-users@...
https://lists.sourceforge.net/lists/listinfo/dvdauthor-users

Re: dvdauthor-users@lists.sourceforge.net.

by Andreas Falch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.


> Date: Thu, 3 Sep 2009 21:35:42 +1200
> From: ldo@...
> > It seems there is no file existence check on -x argument in dvdcli.c. This causes
> > Segmentation fault when a non-existing file is given as argument:
>
> Yeah
> <http://sourceforge.net/mailarchive/message.php?msg_name=78jvum%241d4grh%40smtp.mailfilter6.ihug.co.nz>.

Ok, I see.

One should not expect any new releases from the original author then?  I use the dvdauthor shipped with ubuntu, which means that I cannot expect bugs like these to be fixed.

Will you continue to maintain your fork on github?

Thanks

Andreas
--




With Windows Live, you can organize, edit, and share your photos.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Dvdauthor-users mailing list
Dvdauthor-users@...
https://lists.sourceforge.net/lists/listinfo/dvdauthor-users

Re: dvdauthor-users@lists.sourceforge.net.

by Joo Martin-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

----
Am Thu, 3 Sep 2009 12:50:05 +0000 schrieb
Andreas Falch <andreas1234567@...>:

> One should not expect any new releases from the  original author then?  
> I use the dvdauthor shipped with ubuntu, which means that I cannot
> expect bugs like these to be fixed.
I have generated new unofficial releases of dvdauthor. You can find
patched sources and Debian packages here:
http://www.joonet.de/dvdauthor/

You can test the Debian packages, perhaps one can be installed on
Ubuntu.

Ciao,  Joo

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Dvdauthor-users mailing list
Dvdauthor-users@...
https://lists.sourceforge.net/lists/listinfo/dvdauthor-users

Re: dvdauthor maintenance

by Lawrence D'Oliveiro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Andreas Falch wrote:

> I use the dvdauthor shipped with ubuntu, which means that I cannot
 > expect bugs like these to be fixed.

At the moment I guess there is no official “upstream” maintainer. If you
want a more up-to-date version of dvdauthor, you’re going to have to
build it yourself.

> Will you continue to maintain your fork on github?

What I’ve mainly been doing at the moment is trying to understand how
the code works, and inserting corresponding explanatory comments.

For reference, here
<http://wiki.github.com/ldo/dvdauthor/useful-looking-patches> is a list
of links to patches that I propose to merge some day.

And here <http://wiki.github.com/ldo/dvdauthor/dvdauthor-xml-syntax> is
a summary of the dvdauthor XML syntax gleaned from my examinations of
the code so far. This includes parts not documented in the man page, as
well as those bits generated by dvdunauthor but are not currently
understood by dvdauthor.

This is still very much a part-time activity for me.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Dvdauthor-users mailing list
Dvdauthor-users@...
https://lists.sourceforge.net/lists/listinfo/dvdauthor-users