add test/data for video support : add enforce exceptions
This commit is contained in:
parent
340b46623d
commit
19f8b437c3
@ -4,6 +4,7 @@
|
||||
#include <iostream>
|
||||
#include "basicio.hpp"
|
||||
#include "config.h"
|
||||
#include "enforce.hpp"
|
||||
#include "error.hpp"
|
||||
#include "futils.hpp"
|
||||
#include "helper_functions.hpp"
|
||||
@ -370,7 +371,8 @@ void AsfVideo::codecList() {
|
||||
xmpData()[codec + std::string(".CodecDescription")] = readStringWcharTag(io_, codec_desc_length);
|
||||
|
||||
uint16_t codec_info_length = readWORDTag(io_);
|
||||
if (codec_info_length && codec_info_length + io_->tell() <= io_->size())
|
||||
Internal::enforce(codec_info_length && codec_info_length + io_->tell() < io_->size(),
|
||||
Exiv2::ErrorCode::kerCorruptedMetadata);
|
||||
xmpData()[codec + std::string(".CodecInfo")] = readStringTag(io_, codec_info_length);
|
||||
}
|
||||
} // AsfVideo::codecList
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
|
||||
// included header files
|
||||
#include "riffvideo.hpp"
|
||||
#include "enforce.hpp"
|
||||
#include "error.hpp"
|
||||
#include "futils.hpp"
|
||||
#include "helper_functions.hpp"
|
||||
@ -388,11 +389,10 @@ void RiffVideo::readMetadata() {
|
||||
} // RiffVideo::readMetadata
|
||||
|
||||
RiffVideo::HeaderReader::HeaderReader(BasicIo::UniquePtr& io) {
|
||||
if (io->size() >= io->tell() + DWORD + DWORD) {
|
||||
Internal::enforce(io->size() > io->tell() + DWORD + DWORD, Exiv2::ErrorCode::kerCorruptedMetadata);
|
||||
id_ = readStringTag(io);
|
||||
size_ = readDWORDTag(io);
|
||||
}
|
||||
}
|
||||
|
||||
bool RiffVideo::equal(const std::string& str1, const std::string& str2) {
|
||||
if (str1.size() != str2.size())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user