[FFmpeg-devel] [PATCH 2/3] avformat/tty: Fix division by 0 in probe

Michael Niedermayer michaelni at gmx.at
Fri Feb 7 13:44:27 EET 2020


On Fri, Feb 07, 2020 at 12:19:32AM +0100, Hendrik Leppkes wrote:
> On Fri, Feb 7, 2020 at 12:16 AM Michael Niedermayer <michaelni at gmx.at> wrote:
> >
> > On Thu, Feb 06, 2020 at 03:27:11PM +0100, Paul B Mahol wrote:
> > > Nonsense, why would this code be called with 0 buffer?
> >
> > I guess because code calls av_probe_input_format3() with a 0 buffer
> > its a public function and called by multiple places from our code base
> > as well. Theres even code in it to handle the case of a 0 sized input.
> >
> > The code that triggers it in this case seems to be probing the stream
> > content. Its not a 0 byte input file
> >
> 
> The generic code in the public API calls should probably catch that
> then, a probe function really can't do anything meaningful on a NULL
> or zero-sized buffer.

some of our probe functions have code to handle zero buffers,
an example of this is to search the file name for placeholders
like %d with image extensions. If the file failed to open and has that
in its name that identifies it as a sequence of images.

I suspect v4l2 will also give you a 0 buffer and i guess there are
others


Thanks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200207/e74f6027/attachment.sig>


More information about the ffmpeg-devel mailing list