|
@@ -4232,6 +4232,7 @@ long ContentEncoding::ParseContentEncodingEntry(long long start, long long size,
|
|
new (std::nothrow) ContentEncryption*[encryption_count];
|
|
new (std::nothrow) ContentEncryption*[encryption_count];
|
|
if (!encryption_entries_) {
|
|
if (!encryption_entries_) {
|
|
delete[] compression_entries_;
|
|
delete[] compression_entries_;
|
|
|
|
+ compression_entries_ = NULL;
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
encryption_entries_end_ = encryption_entries_;
|
|
encryption_entries_end_ = encryption_entries_;
|
|
@@ -4263,6 +4264,7 @@ long ContentEncoding::ParseContentEncodingEntry(long long start, long long size,
|
|
delete compression;
|
|
delete compression;
|
|
return status;
|
|
return status;
|
|
}
|
|
}
|
|
|
|
+ assert(compression_count > 0);
|
|
*compression_entries_end_++ = compression;
|
|
*compression_entries_end_++ = compression;
|
|
} else if (id == libwebm::kMkvContentEncryption) {
|
|
} else if (id == libwebm::kMkvContentEncryption) {
|
|
ContentEncryption* const encryption =
|
|
ContentEncryption* const encryption =
|
|
@@ -4275,6 +4277,7 @@ long ContentEncoding::ParseContentEncodingEntry(long long start, long long size,
|
|
delete encryption;
|
|
delete encryption;
|
|
return status;
|
|
return status;
|
|
}
|
|
}
|
|
|
|
+ assert(encryption_count > 0);
|
|
*encryption_entries_end_++ = encryption;
|
|
*encryption_entries_end_++ = encryption;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -4326,7 +4329,12 @@ long ContentEncoding::ParseCompressionEntry(long long start, long long size,
|
|
delete[] buf;
|
|
delete[] buf;
|
|
return status;
|
|
return status;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ // There should be only one settings element per content compression.
|
|
|
|
+ if (compression->settings != NULL) {
|
|
|
|
+ delete[] buf;
|
|
|
|
+ return E_FILE_FORMAT_INVALID;
|
|
|
|
+ }
|
|
|
|
+
|
|
compression->settings = buf;
|
|
compression->settings = buf;
|
|
compression->settings_len = buflen;
|
|
compression->settings_len = buflen;
|
|
}
|
|
}
|