@@ -235,7 +235,7 @@ void AsfVideo::readMetadata() {
235
235
236
236
AsfVideo::HeaderReader::HeaderReader (const BasicIo::UniquePtr& io) : IdBuf_(GUID) {
237
237
if (io->size () >= io->tell () + GUID + QWORD) {
238
- IdBuf_ = io->read (GUID );
238
+ io->readOrThrow (IdBuf_. data (), IdBuf_. size (), Exiv2::ErrorCode::kerCorruptedMetadata );
239
239
240
240
size_ = readQWORDTag (io);
241
241
if (size_ >= GUID + QWORD)
@@ -291,7 +291,7 @@ void AsfVideo::decodeBlock() {
291
291
292
292
void AsfVideo::decodeHeader () {
293
293
DataBuf nbHeadersBuf (DWORD + 1 );
294
- io_->read (nbHeadersBuf.data (), DWORD);
294
+ io_->readOrThrow (nbHeadersBuf.data (), DWORD, Exiv2::ErrorCode::kerCorruptedMetadata );
295
295
296
296
uint32_t nb_headers = Exiv2::getULong (nbHeadersBuf.data (), littleEndian);
297
297
Internal::enforce (nb_headers < std::numeric_limits<uint32_t >::max (), Exiv2::ErrorCode::kerCorruptedMetadata);
@@ -353,7 +353,8 @@ void AsfVideo::DegradableJPEGMedia() {
353
353
}
354
354
355
355
void AsfVideo::streamProperties () {
356
- DataBuf streamTypedBuf = io_->read (GUID);
356
+ DataBuf streamTypedBuf (GUID);
357
+ io_->readOrThrow (streamTypedBuf.data (), streamTypedBuf.size (), Exiv2::ErrorCode::kerCorruptedMetadata);
357
358
358
359
enum class streamTypeInfo { Audio = 1 , Video = 2 };
359
360
auto stream = static_cast <streamTypeInfo>(0 );
@@ -471,7 +472,8 @@ void AsfVideo::contentDescription() {
471
472
} // AsfVideo::extendedContentDescription
472
473
473
474
void AsfVideo::fileProperties () {
474
- DataBuf FileIddBuf = io_->read (GUID);
475
+ DataBuf FileIddBuf (GUID);
476
+ io_->readOrThrow (FileIddBuf.data (), FileIddBuf.size (), Exiv2::ErrorCode::kerCorruptedMetadata);
475
477
xmpData ()[" Xmp.video.FileID" ] = GUIDTag (FileIddBuf.data ()).to_string ();
476
478
xmpData ()[" Xmp.video.FileLength" ] = readQWORDTag (io_);
477
479
xmpData ()[" Xmp.video.CreationDate" ] = readQWORDTag (io_);
0 commit comments