@@ -238,7 +238,7 @@ void AsfVideo::readMetadata() {
238
238
239
239
AsfVideo::HeaderReader::HeaderReader (const BasicIo::UniquePtr& io) : IdBuf_(GUID) {
240
240
if (io->size () >= io->tell () + GUID + QWORD) {
241
- IdBuf_ = io->read (GUID );
241
+ io->readOrThrow (IdBuf_. data (), IdBuf_. size (), Exiv2::ErrorCode::kerCorruptedMetadata );
242
242
243
243
size_ = readQWORDTag (io);
244
244
if (size_ >= GUID + QWORD)
@@ -296,7 +296,7 @@ void AsfVideo::decodeBlock() {
296
296
297
297
void AsfVideo::decodeHeader () {
298
298
DataBuf nbHeadersBuf (DWORD + 1 );
299
- io_->read (nbHeadersBuf.data (), DWORD);
299
+ io_->readOrThrow (nbHeadersBuf.data (), DWORD, Exiv2::ErrorCode::kerCorruptedMetadata );
300
300
301
301
uint32_t nb_headers = Exiv2::getULong (nbHeadersBuf.data (), littleEndian);
302
302
Internal::enforce (nb_headers < std::numeric_limits<uint32_t >::max (), Exiv2::ErrorCode::kerCorruptedMetadata);
@@ -358,7 +358,8 @@ void AsfVideo::DegradableJPEGMedia() {
358
358
}
359
359
360
360
void AsfVideo::streamProperties () {
361
- DataBuf streamTypedBuf = io_->read (GUID);
361
+ DataBuf streamTypedBuf (GUID);
362
+ io_->readOrThrow (streamTypedBuf.data (), streamTypedBuf.size (), Exiv2::ErrorCode::kerCorruptedMetadata);
362
363
363
364
enum class streamTypeInfo { Audio = 1 , Video = 2 };
364
365
auto stream = static_cast <streamTypeInfo>(0 );
@@ -476,7 +477,8 @@ void AsfVideo::contentDescription() {
476
477
} // AsfVideo::extendedContentDescription
477
478
478
479
void AsfVideo::fileProperties () {
479
- DataBuf FileIddBuf = io_->read (GUID);
480
+ DataBuf FileIddBuf (GUID);
481
+ io_->readOrThrow (FileIddBuf.data (), FileIddBuf.size (), Exiv2::ErrorCode::kerCorruptedMetadata);
480
482
xmpData ()[" Xmp.video.FileID" ] = GUIDTag (FileIddBuf.data ()).to_string ();
481
483
xmpData ()[" Xmp.video.FileLength" ] = readQWORDTag (io_);
482
484
xmpData ()[" Xmp.video.CreationDate" ] = readQWORDTag (io_);
0 commit comments