fix(quicktimevideo) avoid out of bounds read, closes #2340

main
Christoph Hasse 3 years ago
parent 7a92e1bd0f
commit 337fe1854f

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

Loading…
Cancel
Save