-
Notifications
You must be signed in to change notification settings - Fork 317
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
base: main
Are you sure you want to change the base?
Changes from all commits
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 = 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() && io_->tell() + 4 <= search_end) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| io_->readOrThrow(buf.data(), 4); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1129
to
1137
|
||||||||||||||||||||||||||||||||||||||||||||||||
| if (equalsQTimeTag(buf, "hdlr")) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| if (io_->tell() + 12 > search_end) | ||||||||||||||||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1136
to
+1140
|
||||||||||||||||||||||||||||||||||||||||||||||||
| while (!io_->eof() && io_->tell() + 4 <= search_end) { | |
| io_->readOrThrow(buf.data(), 4); | |
| if (equalsQTimeTag(buf, "hdlr")) { | |
| if (io_->tell() + 12 > search_end) | |
| break; | |
| while (!io_->eof()) { | |
| // Ensure there are at least 4 bytes remaining before reading | |
| size_t pos = io_->tell(); | |
| if (pos >= search_end) | |
| break; | |
| size_t remaining = search_end - pos; | |
| if (remaining < 4) | |
| break; | |
| io_->readOrThrow(buf.data(), 4); | |
| if (equalsQTimeTag(buf, "hdlr")) { | |
| // After reading "hdlr", ensure there are at least 12 bytes remaining | |
| pos = io_->tell(); | |
| if (pos >= search_end) | |
| break; | |
| remaining = search_end - pos; | |
| if (remaining < 12) | |
| break; |
Uh oh!
There was an error while loading. Please reload this page.