[FFmpeg-devel] Patch proposal : Fix crash with astats filter when no audio input

Nicolas George george at nsup.org
Sun Mar 8 11:18:56 CET 2015


L'octidi 18 ventôse, an CCXXIII, Martin Vignali a écrit :
> In attach a sample file, who make a crash. (on mac os x with latest git
> version, and on windows with older version).
> 
> i just make the test now, and s->nb_channels can be 0. (this is the case
> with the file in attach).

Ok, got it.

The problem happens when the filter is inited but something fails during
configuration. For example when using it with a video stream.

In that case, I believe Paul's fix is wrong, because no attempt at printing
stats should be done at all in that case. "s->channels" can indeed serve to
test if the configuration succeeded, but it must happen earlier, probably
something like that:

    if (s->nb_channels)
        print_stats(ctx);

Furthermore, the global stats should be printed for an empty stream,
otherwise it will break scripts.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150308/ca4ac193/attachment.asc>


More information about the ffmpeg-devel mailing list