aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Trimble <modmaker@google.com>2018-01-30 11:14:35 -0800
committerMichael Niedermayer <michael@niedermayer.cc>2018-04-19 21:49:47 +0200
commitbaf9c0bd99d91ec501b020632ca72babc455139c (patch)
tree18cc9df4e18bf0734804cdf94361e11b2c3cbd09
parent606c5c7f3ad1d289ef745b9053024ad318646c7e (diff)
downloadffmpeg-baf9c0bd99d91ec501b020632ca72babc455139c.tar.gz
avformat/mov: Remove old encryption info methods.
Signed-off-by: Jacob Trimble <modmaker@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/isom.h10
-rw-r--r--libavformat/mov.c91
2 files changed, 0 insertions, 101 deletions
diff --git a/libavformat/isom.h b/libavformat/isom.h
index eb942cf882..4245d37767 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -224,16 +224,6 @@ typedef struct MOVStreamContext {
int has_sidx; // If there is an sidx entry for this stream.
struct {
- // TODO: Remove once old methods are removed from mov.c
- int use_subsamples;
- uint8_t* auxiliary_info;
- uint8_t* auxiliary_info_end;
- uint8_t* auxiliary_info_pos;
- uint8_t auxiliary_info_default_size;
- uint8_t* auxiliary_info_sizes;
- size_t auxiliary_info_sizes_count;
- int64_t auxiliary_info_index;
-
struct AVAESCTR* aes_ctr;
unsigned int per_sample_iv_size; // Either 0, 8, or 16.
AVEncryptionInfo *default_encrypted_sample;
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 4eda48d617..45d8e1dce7 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -6009,67 +6009,6 @@ static int mov_read_tenc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return 0;
}
-static int mov_read_saiz(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
- AVStream *st;
- MOVStreamContext *sc;
- size_t data_size;
- int atom_header_size;
- int flags;
-
- if (c->decryption_key_len == 0 || c->fc->nb_streams < 1)
- return 0;
-
- st = c->fc->streams[c->fc->nb_streams - 1];
- sc = st->priv_data;
-
- if (sc->cenc.auxiliary_info_sizes || sc->cenc.auxiliary_info_default_size) {
- av_log(c->fc, AV_LOG_ERROR, "duplicate saiz atom\n");
- return AVERROR_INVALIDDATA;
- }
-
- atom_header_size = 9;
-
- avio_r8(pb); /* version */
- flags = avio_rb24(pb);
-
- if ((flags & 0x01) != 0) {
- atom_header_size += 8;
-
- avio_rb32(pb); /* info type */
- avio_rb32(pb); /* info type param */
- }
-
- sc->cenc.auxiliary_info_default_size = avio_r8(pb);
- avio_rb32(pb); /* entries */
-
- if (atom.size <= atom_header_size) {
- return 0;
- }
-
- if (atom.size > FFMIN(INT_MAX, SIZE_MAX)) {
- av_log(c->fc, AV_LOG_ERROR, "saiz atom auxiliary_info_sizes size %"PRId64" invalid\n", atom.size);
- return AVERROR_INVALIDDATA;
- }
-
- /* save the auxiliary info sizes as is */
- data_size = atom.size - atom_header_size;
-
- sc->cenc.auxiliary_info_sizes = av_malloc(data_size);
- if (!sc->cenc.auxiliary_info_sizes) {
- return AVERROR(ENOMEM);
- }
-
- sc->cenc.auxiliary_info_sizes_count = data_size;
-
- if (avio_read(pb, sc->cenc.auxiliary_info_sizes, data_size) != data_size) {
- av_log(c->fc, AV_LOG_ERROR, "failed to read the auxiliary info sizes");
- return AVERROR_INVALIDDATA;
- }
-
- return 0;
-}
-
static int mov_read_dfla(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
@@ -6107,36 +6046,6 @@ static int mov_read_dfla(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return 0;
}
-static int mov_seek_auxiliary_info(MOVContext *c, MOVStreamContext *sc, int64_t index)
-{
- size_t auxiliary_info_seek_offset = 0;
- int i;
-
- if (sc->cenc.auxiliary_info_default_size) {
- auxiliary_info_seek_offset = (size_t)sc->cenc.auxiliary_info_default_size * index;
- } else if (sc->cenc.auxiliary_info_sizes) {
- if (index > sc->cenc.auxiliary_info_sizes_count) {
- av_log(c, AV_LOG_ERROR, "current sample %"PRId64" greater than the number of auxiliary info sample sizes %"SIZE_SPECIFIER"\n",
- index, sc->cenc.auxiliary_info_sizes_count);
- return AVERROR_INVALIDDATA;
- }
-
- for (i = 0; i < index; i++) {
- auxiliary_info_seek_offset += sc->cenc.auxiliary_info_sizes[i];
- }
- }
-
- if (auxiliary_info_seek_offset > sc->cenc.auxiliary_info_end - sc->cenc.auxiliary_info) {
- av_log(c, AV_LOG_ERROR, "auxiliary info offset %"SIZE_SPECIFIER" greater than auxiliary info size %"SIZE_SPECIFIER"\n",
- auxiliary_info_seek_offset, (size_t)(sc->cenc.auxiliary_info_end - sc->cenc.auxiliary_info));
- return AVERROR_INVALIDDATA;
- }
-
- sc->cenc.auxiliary_info_pos = sc->cenc.auxiliary_info + auxiliary_info_seek_offset;
- sc->cenc.auxiliary_info_index = index;
- return 0;
-}
-
static int cenc_decrypt(MOVContext *c, MOVStreamContext *sc, AVEncryptionInfo *sample, uint8_t *input, int size)
{
int i, ret;