diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-02-21 05:15:58 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-02-21 07:41:21 +0400 |
commit | 20fa3fb93d0f3d3eab2b1f63a03168f492fae047 (patch) | |
tree | 90fa70ad35ccdf03897ecaec52ac938ec54f9dbc /libavformat/movenc.c | |
parent | 1b872de8f49e9af41d4bc23e1ef783ae8094ffff (diff) |
avformat/movenc: assert that get_cluster_duration() value is valid
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r-- | libavformat/movenc.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index bb4d379c6c..af7efc9ba1 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -614,7 +614,12 @@ static int get_cluster_duration(MOVTrack *track, int cluster_idx) else next_dts = track->cluster[cluster_idx + 1].dts; - return next_dts - track->cluster[cluster_idx].dts; + next_dts -= track->cluster[cluster_idx].dts; + + av_assert0(next_dts >= 0); + av_assert0(next_dts <= INT_MAX); + + return next_dts; } static int get_samples_per_packet(MOVTrack *track) |