Skip to content

Commit 337fe18

Browse files
committed
fix(quicktimevideo) avoid out of bounds read, closes #2340
1 parent 7a92e1b commit 337fe18

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/quicktimevideo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ void QuickTimeVideo::previewTagDecoder(size_t size) {
668668
if (equalsQTimeTag(buf, "PICT"))
669669
xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
670670
else
671-
xmpData_["Xmp.video.PreviewAtomType"] = Exiv2::toString(buf.data());
671+
xmpData_["Xmp.video.PreviewAtomType"] = std::string{buf.c_str(), 4};
672672

673673
io_->seek(cur_pos + size, BasicIo::beg);
674674
} // QuickTimeVideo::previewTagDecoder
@@ -685,7 +685,7 @@ void QuickTimeVideo::keysTagDecoder(size_t size) {
685685
if (equalsQTimeTag(buf, "PICT"))
686686
xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
687687
else
688-
xmpData_["Xmp.video.PreviewAtomType"] = Exiv2::toString(buf.data());
688+
xmpData_["Xmp.video.PreviewAtomType"] = std::string{buf.c_str(), 4};
689689

690690
io_->seek(cur_pos + size, BasicIo::beg);
691691
} // QuickTimeVideo::keysTagDecoder

0 commit comments

Comments
 (0)