-
Notifications
You must be signed in to change notification settings - Fork 322
Bound setMediaStream search to the trak atom size #9286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b5cb228
fd3f4fb
f36a5ae
ee13a61
44b9b7d
02d5e63
6aef39d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -645,7 +645,7 @@ void QuickTimeVideo::tagDecoder(Exiv2::DataBuf& buf, size_t size, size_t recursi | |
| fileTypeDecoder(size); | ||
|
|
||
| else if (equalsQTimeTag(buf, "trak")) | ||
| setMediaStream(); | ||
| setMediaStream(size); | ||
|
|
||
| else if (equalsQTimeTag(buf, "mvhd")) | ||
| movieHeaderDecoder(size); | ||
|
|
@@ -1126,13 +1126,18 @@ void QuickTimeVideo::NikonTagsDecoder(size_t size) { | |
| io_->seek(cur_pos + size, BasicIo::beg); | ||
| } // QuickTimeVideo::NikonTagsDecoder | ||
|
|
||
| void QuickTimeVideo::setMediaStream() { | ||
| void QuickTimeVideo::setMediaStream(size_t atom_size) { | ||
| size_t current_position = io_->tell(); | ||
| size_t search_end = Safe::add(current_position, atom_size); | ||
| if (search_end > io_->size()) | ||
| search_end = io_->size(); | ||
|
Comment on lines
+1129
to
+1133
|
||
| DataBuf buf(4 + 1); | ||
|
|
||
| while (!io_->eof()) { | ||
| while (!io_->eof() && Safe::add(io_->tell(), size_t{4}) <= search_end) { | ||
| io_->readOrThrow(buf.data(), 4); | ||
|
Comment on lines
+1129
to
1137
|
||
| if (equalsQTimeTag(buf, "hdlr")) { | ||
| if (Safe::add(io_->tell(), size_t{12}) > search_end) | ||
| break; | ||
| io_->readOrThrow(buf.data(), 4); | ||
| io_->readOrThrow(buf.data(), 4); | ||
| io_->readOrThrow(buf.data(), 4); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.