[FFmpeg-devel] Testing failure paths (Was: Re: [PATCH v2 2/3] avformat/hashenc: use an array of hashes)

Moritz Barsnick barsnick at gmx.net
Wed Sep 11 17:53:32 EEST 2019


On Wed, Sep 11, 2019 at 10:39:40 -0300, James Almer wrote:
> > +static void hash_free(struct AVFormatContext *s)
> > +{
> > +    struct HashContext *c = s->priv_data;
> > +    av_hash_freep(&c->hashes[0]);
>
> AVOutputFormat.deinit() is called when AVOutputFormat.init() fails, so
> c->hashes can be NULL. same with the framehash muxer.

BTW, do we have any tools or methods for triggering these failure paths
(without modifying the tested code)? Like an LD_PRELOAD lib to randomly
or directedly fail av_malloc*()? Or is all this covered by review and
fuzzing(?) only?

I only do random short use cases and corner/error cases with valgrind,
but that doesn't hit ENOMEM.

Thanks,
Moritz


More information about the ffmpeg-devel mailing list