Bug 157631 - playdv aborts with bus error on empty file
Summary: playdv aborts with bus error on empty file
Status: RESOLVED FIXED
Alias: None
Product: SUSE Linux 10.1
Classification: openSUSE
Component: Other (show other bugs)
Version: Beta 7
Hardware: All SuSE Linux 10.1
: P5 - None : Minor (vote)
Target Milestone: RC 1
Assignee: Bernhard Kaindl
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-13 16:41 UTC by Juergen Weigert
Modified: 2006-03-22 12:01 UTC (History)
1 user (show)

See Also:
Found By: Development
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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