[FFmpeg-devel] [PATCH 1/2] libavformat/mxfenc.c: Fix segfault when writing an audio packet when there has not been a video one.

Tomas Härdin tomas.hardin at codemill.se
Wed Oct 21 22:43:04 CEST 2015


On Tue, 2015-10-20 at 16:43 +0200, Marton Balint wrote:
> On Mon, 19 Oct 2015, Tomas Härdin wrote:
> 
> > On Mon, 2015-10-19 at 11:40 +0200, Alexis Ballier wrote:
> >> On Mon, 19 Oct 2015 10:30:00 +0200
> >> Michael Niedermayer <michael at niedermayer.cc> wrote:
> >>
> >>> On Fri, Oct 16, 2015 at 10:42:32AM +0200, Alexis Ballier wrote:
> >>>> This happens when writing the trailer of a file containing audio
> >>>> but that has not muxed any video packet. Fixes ticket #4817.
> >>>>
> >>>> ----
> >>>
> >>> from IRC:
> >>> <thardin> maybe it should print a warning that there has been no
> >>> video?
> >>
> >> maybe, but what would be the right condition ? just this case ? or when
> >> writing any edit unit without video? or... ?
> >> I haven't been able to find clear references on this (well, those smpte
> >> specs I googled aren't esp. easy to read either), but e.g. the muxer
> >> refuses to mux without exactly one video stream, so maybe, an empty
> >> video stream is also an error; I don't know
> >
> > I'm not particularly fond of second-guessing these kinds of things. D-10
> > is really anal about what constitutes a legal file, so it's probably
> > best not to write anything if something seems amiss. In the end, the
> > real test for correctness is whether the output works with all gear for
> > your particular use case. But segfaults are important to fix, so I'm not
> > too concerned here. Plus my main concern is mxfdec, not mxfenc.
> >
> 
> Why not simply return error and print an error explaining "An audio packet 
> was muxed before a video, this is not supported."
> 
> Segfault -> error is much better than segfault -> possibly broken file.

Yes, simply bailing out is infinitely better than segfaulting. It's also
the more conservative approach, which I am for

/Tomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151021/d429a4f2/attachment.sig>


More information about the ffmpeg-devel mailing list