[FFmpeg-devel] Possible minor bug found in AVI decoder

Eric Beuque eric.beuque at gmail.com
Fri May 12 12:33:20 EEST 2017


Hi,

i'm not really sure but i think a found a bug in the avi decoder of
avformat.

In the following function of the avidec.c:

static int avi_read_header(AVFormatContext *s)
{
    ...
        switch (tag) {
            ...
        case MKTAG('s', 't', 'r', 'f'):
            /* stream header */
            if (!size)
                break;
            if (stream_index >= (unsigned)s->nb_streams || avi->dv_demux) {
                avio_skip(pb, size);
            } else {
                ...
                switch (codec_type) {
                ...
                default:
                    st->codec->codec_type = AVMEDIA_TYPE_DATA;
                    st->codec->codec_id   = AV_CODEC_ID_NONE;
                    st->codec->codec_tag  = 0;
                    avio_skip(pb, size);
                    break;
                }
            }
            break;
        ...
}

If the codec_type is AVMEDIA_TYPE_DATA, but the format is empty (size=0)
(which i think is allowed), then the codec_id is not set to
AV_CODEC_ID_NONE.

This will generate a trace when calling the avformat_find_stream_info:
"Could not find codec parameters for stream 1 (Unknown: none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize'
options"

I'm not really sure about he AVI spec if the format is mandatory or not,
but i think there is a bug.


More information about the ffmpeg-devel mailing list