[FFmpeg-devel] [PATCH] avformat/concatdec: Check that the opened file contains a stream.

Nicolas George george at nsup.org
Sun May 31 12:35:37 CEST 2015

Le duodi 12 prairial, an CCXXIII, Michael Niedermayer a écrit :
> Fixes segfault from ticket 4350

Not ok. concat should work with files with no streams, especially if streams
can be discovered later.

The bug you are trying to fix is in mxfdec.c:

static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)
    /* OPAtom - clip wrapped demuxing */
    /* NOTE: mxf_read_header() makes sure nb_index_tables > 0 for OPAtom */
    st = s->streams[0];
    t = &mxf->index_tables[0];

I do not know the MXF format. If MXF files without streams are not possible,
then the correct fix is to add a check at the end of mxf_read_header().

You can reproduce the segfault without concat, just:

zsh: segmentation fault  ./ffprobe_g -show_packets /tmp/0001V004.MXF


  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/20150531/58235db5/attachment.asc>

More information about the ffmpeg-devel mailing list