[FFmpeg-devel] [PATCH] Vivo demuxer

Michael Niedermayer michaelni at gmx.at
Fri Nov 16 15:09:38 CET 2012


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


[...]
-- 
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121116/81895f70/attachment.asc>


More information about the ffmpeg-devel mailing list