[FFmpeg-devel] [PATCH] AFC demuxer

Michael Niedermayer michaelni at gmx.at
Tue Nov 27 04:06:16 CET 2012


On Mon, Nov 26, 2012 at 08:46:29PM +0000, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
[...]
> +static int afc_read_header(AVFormatContext *s)
> +{
> +    AFCDemuxContext *c = s->priv_data;
> +    AVStream *st;
> +
> +    st = avformat_new_stream(s, NULL);
> +    if (!st)
> +        return AVERROR(ENOMEM);
> +    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
> +    st->codec->codec_id   = AV_CODEC_ID_ADPCM_AFC;
> +    st->codec->channels   = 2;
> +    st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
> +    st->codec->extradata_size = 1;
> +
> +    st->codec->extradata = av_mallocz(1 + FF_INPUT_BUFFER_PADDING_SIZE);
> +    if (!st->codec->extradata)
> +        return AVERROR(ENOMEM);
> +    st->codec->extradata[0] = 8 * st->codec->channels;
> +

> +    c->data_end = avio_rb32(s->pb) + 32;

the addition could overflow theoretically, 32LL or something would
avoid it

patch LGTM otherwise

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

During times of universal deceit, telling the truth becomes a
revolutionary act. -- George Orwell
-------------- 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/20121127/84805bdd/attachment.asc>


More information about the ffmpeg-devel mailing list