Bug 1407833 - update rust mp4 parser for add overflow. r?kinetik
MozReview-Commit-ID: 8nGLWcXmGCr
--- a/media/libstagefright/binding/mp4parse_capi/src/lib.rs
+++ b/media/libstagefright/binding/mp4parse_capi/src/lib.rs
@@ -836,17 +836,20 @@ impl<'a> Iterator for SampleToChunkItera
(Some(next), Some(peek)) if next.first_chunk > 0 && peek.first_chunk > 0 => {
self.sample_count = next.samples_per_chunk;
((next.first_chunk - 1) .. (peek.first_chunk - 1))
},
(Some(next), None) if next.first_chunk > 0 => {
self.sample_count = next.samples_per_chunk;
// Total chunk number in 'stsc' could be different to 'stco',
// there could be more chunks at the last 'stsc' record.
- ((next.first_chunk - 1) .. next.first_chunk + self.remain_chunk_count -1)
+ match next.first_chunk.checked_add(self.remain_chunk_count) {
+ Some(r) => ((next.first_chunk - 1) .. r - 1),
+ _ => (0 .. 0),
+ }
},
_ => (0 .. 0),
};
self.remain_chunk_count.checked_sub(self.chunks.len() as u32).and_then(|res| {
self.remain_chunk_count = res;
self.chunks.next()
})
--- a/media/libstagefright/binding/update-rust.sh
+++ b/media/libstagefright/binding/update-rust.sh
@@ -1,13 +1,13 @@
#!/bin/sh -e
# Script to update mp4parse-rust sources to latest upstream
# Default version.
-VER=7a10a8349b7dc098210deb0872de801e30f2d65e
+VER=cfeeab0036e14658f28f8df16c7ddede46ccf79a
# Accept version or commit from the command line.
if test -n "$1"; then
VER=$1
fi
echo "Fetching sources..."
rm -rf _upstream