Commit e93bc3ef authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/avidec: use ff_get_extradata()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent f04fc386
......@@ -654,11 +654,8 @@ static int avi_read_header(AVFormatContext *s)
st->codec->extradata_size = esize - 10 * 4;
} else
st->codec->extradata_size = size - 10 * 4;
if (ff_alloc_extradata(st->codec, st->codec->extradata_size))
if (ff_get_extradata(st->codec, pb, st->codec->extradata_size) < 0)
return AVERROR(ENOMEM);
avio_read(pb,
st->codec->extradata,
st->codec->extradata_size);
}
// FIXME: check if the encoder really did this correctly
......@@ -783,9 +780,8 @@ static int avi_read_header(AVFormatContext *s)
st = s->streams[stream_index];
if (size<(1<<30)) {
if (ff_alloc_extradata(st->codec, size))
if (ff_get_extradata(st->codec, pb, size) < 0)
return AVERROR(ENOMEM);
avio_read(pb, st->codec->extradata, st->codec->extradata_size);
}
if (st->codec->extradata_size & 1) //FIXME check if the encoder really did this correctly
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment