|
|
@ -1077,11 +1077,8 @@ static int mov_read_wave(MOVContext *c, AVIOContext *pb, MOVAtom atom) |
|
|
|
st->codec->codec_id == AV_CODEC_ID_SPEEX) { |
|
|
|
st->codec->codec_id == AV_CODEC_ID_SPEEX) { |
|
|
|
// pass all frma atom to codec, needed at least for QDMC and QDM2
|
|
|
|
// pass all frma atom to codec, needed at least for QDMC and QDM2
|
|
|
|
av_free(st->codec->extradata); |
|
|
|
av_free(st->codec->extradata); |
|
|
|
st->codec->extradata_size = 0; |
|
|
|
if (ff_alloc_extradata(st->codec, atom.size)) |
|
|
|
st->codec->extradata = av_mallocz(atom.size + FF_INPUT_BUFFER_PADDING_SIZE); |
|
|
|
|
|
|
|
if (!st->codec->extradata) |
|
|
|
|
|
|
|
return AVERROR(ENOMEM); |
|
|
|
return AVERROR(ENOMEM); |
|
|
|
st->codec->extradata_size = atom.size; |
|
|
|
|
|
|
|
avio_read(pb, st->codec->extradata, atom.size); |
|
|
|
avio_read(pb, st->codec->extradata, atom.size); |
|
|
|
} else if (atom.size > 8) { /* to read frma, esds atoms */ |
|
|
|
} else if (atom.size > 8) { /* to read frma, esds atoms */ |
|
|
|
int ret; |
|
|
|
int ret; |
|
|
@ -1117,11 +1114,8 @@ static int mov_read_glbl(MOVContext *c, AVIOContext *pb, MOVAtom atom) |
|
|
|
return mov_read_default(c, pb, atom); |
|
|
|
return mov_read_default(c, pb, atom); |
|
|
|
} |
|
|
|
} |
|
|
|
av_free(st->codec->extradata); |
|
|
|
av_free(st->codec->extradata); |
|
|
|
st->codec->extradata_size = 0; |
|
|
|
if (ff_alloc_extradata(st->codec, atom.size)) |
|
|
|
st->codec->extradata = av_mallocz(atom.size + FF_INPUT_BUFFER_PADDING_SIZE); |
|
|
|
|
|
|
|
if (!st->codec->extradata) |
|
|
|
|
|
|
|
return AVERROR(ENOMEM); |
|
|
|
return AVERROR(ENOMEM); |
|
|
|
st->codec->extradata_size = atom.size; |
|
|
|
|
|
|
|
avio_read(pb, st->codec->extradata, atom.size); |
|
|
|
avio_read(pb, st->codec->extradata, atom.size); |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
@ -1143,11 +1137,8 @@ static int mov_read_dvc1(MOVContext *c, AVIOContext *pb, MOVAtom atom) |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
|
|
|
|
|
|
|
|
av_free(st->codec->extradata); |
|
|
|
av_free(st->codec->extradata); |
|
|
|
st->codec->extradata_size = 0; |
|
|
|
if (ff_alloc_extradata(st->codec, atom.size - 7)) |
|
|
|
st->codec->extradata = av_mallocz(atom.size - 7 + FF_INPUT_BUFFER_PADDING_SIZE); |
|
|
|
|
|
|
|
if (!st->codec->extradata) |
|
|
|
|
|
|
|
return AVERROR(ENOMEM); |
|
|
|
return AVERROR(ENOMEM); |
|
|
|
st->codec->extradata_size = atom.size - 7; |
|
|
|
|
|
|
|
avio_seek(pb, 6, SEEK_CUR); |
|
|
|
avio_seek(pb, 6, SEEK_CUR); |
|
|
|
avio_read(pb, st->codec->extradata, st->codec->extradata_size); |
|
|
|
avio_read(pb, st->codec->extradata, st->codec->extradata_size); |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
@ -1172,11 +1163,8 @@ static int mov_read_strf(MOVContext *c, AVIOContext *pb, MOVAtom atom) |
|
|
|
return AVERROR_INVALIDDATA; |
|
|
|
return AVERROR_INVALIDDATA; |
|
|
|
|
|
|
|
|
|
|
|
av_free(st->codec->extradata); |
|
|
|
av_free(st->codec->extradata); |
|
|
|
st->codec->extradata_size = 0; |
|
|
|
if (ff_alloc_extradata(st->codec, atom.size - 40)) |
|
|
|
st->codec->extradata = av_mallocz(atom.size - 40 + FF_INPUT_BUFFER_PADDING_SIZE); |
|
|
|
|
|
|
|
if (!st->codec->extradata) |
|
|
|
|
|
|
|
return AVERROR(ENOMEM); |
|
|
|
return AVERROR(ENOMEM); |
|
|
|
st->codec->extradata_size = atom.size - 40; |
|
|
|
|
|
|
|
avio_skip(pb, 40); |
|
|
|
avio_skip(pb, 40); |
|
|
|
avio_read(pb, st->codec->extradata, atom.size - 40); |
|
|
|
avio_read(pb, st->codec->extradata, atom.size - 40); |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
@ -1491,9 +1479,7 @@ static int mov_parse_stsd_data(MOVContext *c, AVIOContext *pb, |
|
|
|
int size) |
|
|
|
int size) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (st->codec->codec_tag == MKTAG('t','m','c','d')) { |
|
|
|
if (st->codec->codec_tag == MKTAG('t','m','c','d')) { |
|
|
|
st->codec->extradata_size = size; |
|
|
|
if (ff_alloc_extradata(st->codec, size)) |
|
|
|
st->codec->extradata = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE); |
|
|
|
|
|
|
|
if (!st->codec->extradata) |
|
|
|
|
|
|
|
return AVERROR(ENOMEM); |
|
|
|
return AVERROR(ENOMEM); |
|
|
|
avio_read(pb, st->codec->extradata, size); |
|
|
|
avio_read(pb, st->codec->extradata, size); |
|
|
|
if (size > 16) { |
|
|
|
if (size > 16) { |
|
|
|