Skip to content

Commit

Permalink
nul-terminate string
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinbackhouse authored and neheb committed Sep 29, 2022
1 parent a38e124 commit 0db460c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/quicktimevideo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -846,12 +846,13 @@ void QuickTimeVideo::userDataDecoder(size_t size_external) {

else if (tv) {
const size_t tv_size = size - 12;
if (tv_size > buf.size()) {
if (tv_size >= buf.size()) {
enforce(tv_size <= io_->size() - io_->tell(), Exiv2::ErrorCode::kerCorruptedMetadata);
buf.resize(tv_size);
buf.resize(tv_size + 1);
}
io_->readOrThrow(buf.data(), 4);
io_->readOrThrow(buf.data(), tv_size);
buf.write_uint8(tv_size, 0); // nul-terminate string
xmpData_[exvGettext(tv->label_)] = Exiv2::toString(buf.data());
}

Expand Down

0 comments on commit 0db460c

Please sign in to comment.