Commit 69ce34c7 authored by Michael Niedermayer's avatar Michael Niedermayer

tools/qt-faststart: Fix unintended sign extension of atom_size

Fixes CID733810
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent c1075d6a
...@@ -229,7 +229,7 @@ int main(int argc, char *argv[]) ...@@ -229,7 +229,7 @@ int main(int argc, char *argv[])
atom_type = BE_32(&moov_atom[i]); atom_type = BE_32(&moov_atom[i]);
if (atom_type == STCO_ATOM) { if (atom_type == STCO_ATOM) {
printf(" patching stco atom...\n"); printf(" patching stco atom...\n");
atom_size = BE_32(&moov_atom[i - 4]); atom_size = (uint32_t)BE_32(&moov_atom[i - 4]);
if (i + atom_size - 4 > moov_atom_size) { if (i + atom_size - 4 > moov_atom_size) {
printf(" bad atom size\n"); printf(" bad atom size\n");
goto error_out; goto error_out;
...@@ -250,7 +250,7 @@ int main(int argc, char *argv[]) ...@@ -250,7 +250,7 @@ int main(int argc, char *argv[])
i += atom_size - 4; i += atom_size - 4;
} else if (atom_type == CO64_ATOM) { } else if (atom_type == CO64_ATOM) {
printf(" patching co64 atom...\n"); printf(" patching co64 atom...\n");
atom_size = BE_32(&moov_atom[i - 4]); atom_size = (uint32_t)BE_32(&moov_atom[i - 4]);
if (i + atom_size - 4 > moov_atom_size) { if (i + atom_size - 4 > moov_atom_size) {
printf(" bad atom size\n"); printf(" bad atom size\n");
goto error_out; goto error_out;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment