Bug 157631

Summary: playdv aborts with bus error on empty file
Product: [openSUSE] SUSE Linux 10.1 Reporter: Juergen Weigert <jw>
Component: OtherAssignee: Bernhard Kaindl <bk>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Minor    
Priority: P5 - None CC: suse-beta
Version: Beta 7   
Target Milestone: RC 1   
Hardware: All   
OS: SuSE Linux 10.1   
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Juergen Weigert 2006-03-13 16:41:28 UTC
looks like we miss a trivial sanity check. Reproduce with
$ :> test.dv
$ playdv test.dv
bus error

see the coredump at 

$ showmount -e d110
Export list for d110:
/home/testy/dv *
$


Other files (captured with a Sony VX2000) work nicely.
Comment 1 Bernhard Kaindl 2006-03-21 16:39:27 UTC
I submitted this patch for STABLE:

libdv-filesizecheck.patch

The patch checks if the file is smaller than the smallest
video frame size, and if it's smaller, there can't be a
valid video file in it, hence, the file is truncated:

   if (!dv_player->no_mmap) {
          if(fstat(fd, &dv_player->statbuf)) goto fstatfail;
          eof = dv_player->statbuf.st_size;
+         if (eof < sizeof(dv_header_t) + 120000) { /* 1st frame incomplete */
+               fprintf(stderr, "playdv: File size of %d bytes "
+                       "smaller than frame size, nothing to play!\n", eof);
+               exit(-1);
+         }
   }

Changelog entry:
- Fix playdv abort with Bus Error on empty file (#157631)

Will set to fixed when I know the code release in which it will appear.
Comment 2 Bernhard Kaindl 2006-03-22 12:01:57 UTC
The fix is in stabled (already built), so it will be in the next beta/RC