[FFmpeg-devel] [RFC] avfilter_request_frame() crash

Stefano Sabatini stefano.sabatini-lala
Fri Jan 16 01:49:12 CET 2009


On date Thursday 2009-01-15 23:12:12 +0100, Michael Niedermayer encoded:
> On Thu, Jan 15, 2009 at 09:37:39PM +0100, Vitor Sessak wrote:
> > Stefano Sabatini wrote:
> > > Hi all,
> > > 
> > > when calling avfilter_request_frame() on a link with no source it
> > > crashes, for example with:
> > > 
> > > ffplay -f video4linux -s 320x240 /dev/video -vfilters "[in] setpts=PTS-STARTPTS, hflip, setpts=PTS-STARTPTS [foo]"
> > > 
> > > Should we:
> > > 1) add a check in avfilter_request_frame(), so that it will return -1
> > >    if the link source is NULL
> > > 2) ensure that no dangling links exist before to start to extract
> > >    filters from the filterchain
> > > 3) both 1) and 2)
> > 
> > I'd say (2) or (3), I don't think "[in] setpts=PTS-STARTPTS, hflip, 
> > setpts=PTS-STARTPTS [foo]" should be considered a valid description of a 
> > filter chain.
> 
> agree

With the patch:

stefano at geppetto ~/s/l/ffmpeg> ffplay -f video4linux -s 320x240 /dev/video -vfilters "[in] setpts=PTS-STARTPTS, hflip, setpts=PTS-STARTPTS [foo]"
FFplay version SVN-r16562, Copyright (c) 2003-2009 Fabrice Bellard, et al.
[...]
Output pad "default" for the filter "Parsed filter 2" of type "setpts" not connected to any destination

If we want to avoid 1) we can request the user to call the function
before to start any actual processing, saying that in the docs should
be sufficient.

Regards.
-- 
FFmpeg = Faboulous Friendly Mind-dumbing Prodigious Everlasting Guide
-------------- next part --------------
A non-text attachment was scrubbed...
Name: avfilter-graph-check.patch
Type: text/x-diff
Size: 2356 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090116/d158364d/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffplay-graph-validity-check.patch
Type: text/x-diff
Size: 615 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090116/d158364d/attachment-0001.patch>



More information about the ffmpeg-devel mailing list