"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libavformat/mov.c" between
libav-12.1.tar.gz and libav-12.2.tar.gz

About: libav provides cross-platform tools ("avconv") and libraries to convert, manipulate and stream a wide range of multimedia (audio and video) formats and protocols.

mov.c  (libav-12.1):mov.c  (libav-12.2)
skipping to change at line 1886 skipping to change at line 1886
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
memcpy(sc->extradata[pseudo_stream_id], st->codecpar->extradata, ext ra_size); memcpy(sc->extradata[pseudo_stream_id], st->codecpar->extradata, ext ra_size);
av_freep(&st->codecpar->extradata); av_freep(&st->codecpar->extradata);
st->codecpar->extradata_size = 0; st->codecpar->extradata_size = 0;
} }
} }
if (pb->eof_reached) if (pb->eof_reached)
return AVERROR_EOF; return AVERROR_EOF;
return mov_finalize_stsd_codec(c, pb, st, sc); return 0;
} }
static int mov_read_stsd(MOVContext *c, AVIOContext *pb, MOVAtom atom) static int mov_read_stsd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{ {
AVStream *st; AVStream *st;
MOVStreamContext *sc; MOVStreamContext *sc;
int ret, entries; int ret, entries;
if (c->fc->nb_streams < 1) if (c->fc->nb_streams < 1)
return 0; return 0;
st = c->fc->streams[c->fc->nb_streams - 1]; st = c->fc->streams[c->fc->nb_streams - 1];
sc = st->priv_data; sc = st->priv_data;
avio_r8(pb); /* version */ avio_r8(pb); /* version */
avio_rb24(pb); /* flags */ avio_rb24(pb); /* flags */
entries = avio_rb32(pb); entries = avio_rb32(pb);
if (entries <= 0) {
av_log(c->fc, AV_LOG_ERROR, "invalid STSD entries %d\n", entries);
return AVERROR_INVALIDDATA;
}
if (sc->extradata) { if (sc->extradata) {
av_log(c->fc, AV_LOG_ERROR, av_log(c->fc, AV_LOG_ERROR,
"Duplicate stsd found in this track.\n"); "Duplicate stsd found in this track.\n");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
/* Prepare space for hosting multiple extradata. */ /* Prepare space for hosting multiple extradata. */
sc->extradata = av_mallocz_array(entries, sizeof(*sc->extradata)); sc->extradata = av_mallocz_array(entries, sizeof(*sc->extradata));
if (!sc->extradata) if (!sc->extradata)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
sc->stsd_count = entries; sc->extradata_size = av_mallocz_array(entries, sizeof(*sc->extradata_size));
sc->extradata_size = av_mallocz_array(sc->stsd_count, sizeof(*sc->extradata_ if (!sc->extradata_size) {
size)); ret = AVERROR(ENOMEM);
if (!sc->extradata_size) goto fail;
return AVERROR(ENOMEM); }
ret = ff_mov_read_stsd_entries(c, pb, sc->stsd_count); ret = ff_mov_read_stsd_entries(c, pb, entries);
if (ret < 0) if (ret < 0)
return ret; goto fail;
sc->stsd_count = entries;
/* Restore back the primary extradata. */ /* Restore back the primary extradata. */
av_free(st->codecpar->extradata); av_free(st->codecpar->extradata);
st->codecpar->extradata_size = sc->extradata_size[0]; st->codecpar->extradata_size = sc->extradata_size[0];
st->codecpar->extradata = av_mallocz(sc->extradata_size[0] + AV_INPUT_BUFFER _PADDING_SIZE); st->codecpar->extradata = av_mallocz(sc->extradata_size[0] + AV_INPUT_BUFFER _PADDING_SIZE);
if (!st->codecpar->extradata) if (!st->codecpar->extradata) {
return AVERROR(ENOMEM); ret = AVERROR(ENOMEM);
goto fail;
}
memcpy(st->codecpar->extradata, sc->extradata[0], sc->extradata_size[0]); memcpy(st->codecpar->extradata, sc->extradata[0], sc->extradata_size[0]);
return 0; return mov_finalize_stsd_codec(c, pb, st, sc);
fail:
av_freep(&sc->extradata);
av_freep(&sc->extradata_size);
return ret;
} }
static int mov_read_stsc(MOVContext *c, AVIOContext *pb, MOVAtom atom) static int mov_read_stsc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{ {
AVStream *st; AVStream *st;
MOVStreamContext *sc; MOVStreamContext *sc;
unsigned int i, entries; unsigned int i, entries;
if (c->fc->nb_streams < 1) if (c->fc->nb_streams < 1)
return 0; return 0;
 End of changes. 7 change blocks. 
11 lines changed or deleted 24 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)