[FFmpeg-devel] [PATCH] Vivo demuxer

Paul B Mahol onemda at gmail.com
Fri Nov 16 15:49:31 CET 2012


On 11/16/12, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Fri, Nov 02, 2012 at 07:39:32PM +0000, Paul B Mahol wrote:
>> From: Daniel Verkamp <daniel at drv.nu>
> [...]
>> +static int vivo_read_header(AVFormatContext *s)
>> +{
>> +    VivoContext *vivo = s->priv_data;
>> +    AVRational fps = { 1, 25};
>> +    AVStream *ast, *vst;
>> +    unsigned char *line, *line_end, *key, *value;
>> +    long value_int;
>> +    int ret, value_used;
>> +    int64_t duration = 0;
>> +    char *end_value;
>> +
>> +    vst = avformat_new_stream(s, 0);
>> +    ast = avformat_new_stream(s, 0);
>> +    if (!ast || !vst)
>> +        return AVERROR(ENOMEM);
>> +
>> +    ast->codec->sample_rate = 8000;
>> +
>> +    while (1) {
>> +        if ((ret = vivo_get_packet_header(s)) < 0)
>> +            return ret;
>> +
>> +        // done reading all text header packets?
>> +        if (vivo->sequence || vivo->type)
>> +            break;
>> +
>> +        avio_read(s->pb, vivo->text, vivo->len);
>> +        vivo->text[vivo->len] = 0;
>
> i think this is missing a check on len being within the array size

indeed, fixed localy.
>
>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> If a bugfix only changes things apparently unrelated to the bug with no
> further explanation, that is a good sign that the bugfix is wrong.
>


More information about the ffmpeg-devel mailing list