[FFmpeg-devel] [PATCH] AFC demuxer

Paul B Mahol onemda at gmail.com
Tue Nov 27 11:27:46 CET 2012


On 11/27/12, Michael Niedermayer <michaelni at gmx.at> wrote:
> 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

fixed
>
> patch LGTM otherwise

applied

>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> During times of universal deceit, telling the truth becomes a
> revolutionary act. -- George Orwell
>


More information about the ffmpeg-devel mailing list