summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-09-27 20:42:39 -0300
committerJames Almer <jamrial@gmail.com>2017-09-27 20:43:17 -0300
commitb35f6d3aa359567fa4572a1a982ec6d233929d35 (patch)
tree66e439f7fe2dffc0f18d0abe572e44e48726ff56 /libavformat/mov.c
parent1a115a31d430b71973b1e1556fcf767417449f09 (diff)
parent53ea595eec984e3109310e8bb7ff4b5786d91057 (diff)
Merge commit '53ea595eec984e3109310e8bb7ff4b5786d91057'
* commit '53ea595eec984e3109310e8bb7ff4b5786d91057': mov: Rework stsc index validation See e26e6240b6700c5e8c16d0f092f1ad46805a723c. Merged-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 2de60b2159..19cda1424d 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2447,10 +2447,13 @@ static int mov_read_stsc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return 0;
}
-#define mov_stsc_index_valid(index, count) ((index) < (count) - 1)
+static inline int mov_stsc_index_valid(unsigned int index, unsigned int count)
+{
+ return index < count - 1;
+}
/* Compute the samples value for the stsc entry at the given index. */
-static inline int mov_get_stsc_samples(MOVStreamContext *sc, int index)
+static inline int mov_get_stsc_samples(MOVStreamContext *sc, unsigned int index)
{
int chunk_count;
@@ -6647,7 +6650,7 @@ static int mov_seek_stream(AVFormatContext *s, AVStream *st, int64_t timestamp,
{
MOVStreamContext *sc = st->priv_data;
int sample, time_sample;
- int i;
+ unsigned int i;
int ret = mov_seek_fragment(s, st, timestamp);
if (ret < 0)