rpms/dvgrab/F-8 dvgrab-3.1-bad-timecode-handling.patch, NONE, 1.1 dvgrab-3.1-gcc43-fix.patch, NONE, 1.1

Jarod Wilson (jwilson) fedora-extras-commits at redhat.com
Tue Jun 24 21:29:47 UTC 2008


Author: jwilson

Update of /cvs/pkgs/rpms/dvgrab/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv890

Added Files:
	dvgrab-3.1-bad-timecode-handling.patch 
	dvgrab-3.1-gcc43-fix.patch 
Log Message:
oops, add patches

dvgrab-3.1-bad-timecode-handling.patch:

--- NEW FILE dvgrab-3.1-bad-timecode-handling.patch ---
Date: 2008-04-13 18:42
From: Patrick Mansfield <patman at ar...>
Subject: fix segfault when timecodes are bad

Hi -

I am also hitting bug 1865787 "dvgrab-3.x -autosplit segfaults', this:

http://sourceforge.net/tracker/index.php?func=detail&aid=1865787&group_id=14103&atid=114103

Large timecode values are causing a stack overflow in DVgrab::sendCaptureStatus,
the printf precision for integers specifies the minimum number of digits,
not the maximum, so the tc_str can be longer than 32 bytes.

I don't know WHY the timecodes are so large, but at least it doesn't
segfault with this patch.

With the fix (or while debugging), I am seeing status lines like this:

"again-2003.12.24_09-06-53.avi": 36.91 MiB 322 frames timecode 00:07:56.14 date 2003.12.24 09:07:04
"again-2003.12.24_09-08-20.avi": 74.57 MiB 651 frames timecode 167058900:-1319513512:-1291087864.163713312 date 2008.04.13 11:23:17
"again-2004.01.14_11-32-20.avi": 10.02 MiB 87 frames timecode 00:00:03.15 date 2004.01.14 11:32:23

Without the fix, we segfault before the second line above can be output.

I have a test file if someone wants it, but it is 200Mb in size.

The strings should fit into 47 and 77 bytes respectively, but the fix
allows for some extra space and uses 64 and 128 bytes for the strings in
DVgrab::sendCaptureStatus (even though it is the timecode that was causing
the segfault, we should be safe and increase the size of both strings).

Index: dvgrab/dvgrab.cc
===================================================================
RCS file: /cvsroot/kino/dvgrab/dvgrab.cc,v
retrieving revision 1.61
diff -u -r1.61 dvgrab.cc
--- dvgrab/dvgrab.cc 27 Feb 2008 05:09:48 -0000 1.61
+++ dvgrab/dvgrab.cc 13 Apr 2008 18:27:11 -0000
@@ -779,7 +779,7 @@
 
 void DVgrab::sendCaptureStatus( const char *name, float size, int frames, TimeCode *tc, struct tm *rd, bool newline )
 {
-	char tc_str[32], rd_str[32];
+	char tc_str[64], rd_str[128];
 
 	if ( tc )
 		sprintf( tc_str, "%2.2d:%2.2d:%2.2d.%2.2d", 

dvgrab-3.1-gcc43-fix.patch:

--- NEW FILE dvgrab-3.1-gcc43-fix.patch ---
diff -Naurp dvgrab-3.1.orig/avi.cc dvgrab-3.1/avi.cc
--- dvgrab-3.1.orig/avi.cc	2007-07-06 15:00:36.000000000 -0400
+++ dvgrab-3.1/avi.cc	2008-02-13 14:07:35.000000000 -0500
@@ -20,6 +20,7 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
+#include <string.h>
 
 // C++ includes
 
diff -Naurp dvgrab-3.1.orig/dvframe.cc dvgrab-3.1/dvframe.cc
--- dvgrab-3.1.orig/dvframe.cc	2007-07-06 15:00:36.000000000 -0400
+++ dvgrab-3.1/dvframe.cc	2008-02-13 14:08:41.000000000 -0500
@@ -25,6 +25,7 @@
     \file dvframe.cc
 */
 
+#include <string.h>
 #include "dvframe.h"
 
 VideoInfo::VideoInfo() : width( 0 ), height( 0 ), isPAL( false )
diff -Naurp dvgrab-3.1.orig/dvgrab.cc dvgrab-3.1/dvgrab.cc
--- dvgrab-3.1.orig/dvgrab.cc	2007-12-10 01:57:15.000000000 -0500
+++ dvgrab-3.1/dvgrab.cc	2008-02-13 14:00:08.000000000 -0500
@@ -29,6 +29,7 @@
 using std::cerr;
 using std::endl;
 
+#include <string.h>
 #include <assert.h>
 #include <fcntl.h>
 #include <unistd.h>
diff -Naurp dvgrab-3.1.orig/filehandler.cc dvgrab-3.1/filehandler.cc
--- dvgrab-3.1.orig/filehandler.cc	2007-12-10 01:57:15.000000000 -0500
+++ dvgrab-3.1/filehandler.cc	2008-02-13 14:00:03.000000000 -0500
@@ -34,6 +34,7 @@ using std::ostringstream;
 using std::setw;
 using std::setfill;
 
+#include <string.h>
 #include <stdio.h>
 #include <signal.h>
 #include <unistd.h>
diff -Naurp dvgrab-3.1.orig/hdvframe.cc dvgrab-3.1/hdvframe.cc
--- dvgrab-3.1.orig/hdvframe.cc	2007-12-10 01:16:10.000000000 -0500
+++ dvgrab-3.1/hdvframe.cc	2008-02-13 14:00:40.000000000 -0500
@@ -18,6 +18,7 @@
 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */
 
+#include <string.h>
 #include "hdvframe.h"
 
 HDVFrame::HDVFrame( HDVStreamParams *p )
diff -Naurp dvgrab-3.1.orig/iec13818-1.cc dvgrab-3.1/iec13818-1.cc
--- dvgrab-3.1.orig/iec13818-1.cc	2007-12-10 01:16:10.000000000 -0500
+++ dvgrab-3.1/iec13818-1.cc	2008-02-13 14:00:30.000000000 -0500
@@ -20,6 +20,7 @@
 #include <string>
 using std::string;
 
+#include <string.h>
 #include "hdvframe.h"
 #include "iec13818-1.h"
 
diff -Naurp dvgrab-3.1.orig/ieee1394io.cc dvgrab-3.1/ieee1394io.cc
--- dvgrab-3.1.orig/ieee1394io.cc	2007-12-10 01:16:10.000000000 -0500
+++ dvgrab-3.1/ieee1394io.cc	2008-02-13 14:01:56.000000000 -0500
@@ -49,9 +49,11 @@
 
 #include <deque>
 #include <iostream>
+#include <typeinfo>
 
 using std::endl;
 
+#include <string.h>
 #include <assert.h>
 #include <unistd.h>
 #include <fcntl.h>
diff -Naurp dvgrab-3.1.orig/main.cc dvgrab-3.1/main.cc
--- dvgrab-3.1.orig/main.cc	2007-07-06 15:08:17.000000000 -0400
+++ dvgrab-3.1/main.cc	2008-02-13 14:02:55.000000000 -0500
@@ -36,6 +36,7 @@ using std::endl;
 
 // C includes
 
+#include <string.h>
 #include <unistd.h>
 #include <stdio.h>
 #include <stdlib.h>
diff -Naurp dvgrab-3.1.orig/v4l2reader.cc dvgrab-3.1/v4l2reader.cc
--- dvgrab-3.1.orig/v4l2reader.cc	2007-11-21 23:22:08.000000000 -0500
+++ dvgrab-3.1/v4l2reader.cc	2008-02-13 14:03:07.000000000 -0500
@@ -24,6 +24,7 @@
 
 #include <string>
 
+#include <string.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>




More information about the fedora-extras-commits mailing list