summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-02 22:01:41 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-03 00:02:22 +0100
commit98db90589651474366a32e14e3ad062ef3ca6707 (patch)
tree7716f2eb1e71bc2000609f7443f23ce0616698b1 /libavformat/utils.c
parent740e740895557a3b11715ccb203b7d882496046f (diff)
avformat_seek_file: Dont attempt to rescale INT64_MIN/MAX
This fixes a integer overflow in fate Reviewed-by: Clément Bœsch <ubitux@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index cbf32638c3..096bb82713 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2092,10 +2092,10 @@ int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int
ts = av_rescale_q(ts, AV_TIME_BASE_Q, time_base);
min_ts = av_rescale_rnd(min_ts, time_base.den,
time_base.num * (int64_t)AV_TIME_BASE,
- AV_ROUND_UP);
+ AV_ROUND_UP | AV_ROUND_PASS_MINMAX);
max_ts = av_rescale_rnd(max_ts, time_base.den,
time_base.num * (int64_t)AV_TIME_BASE,
- AV_ROUND_DOWN);
+ AV_ROUND_DOWN | AV_ROUND_PASS_MINMAX);
}
ret = s->iformat->read_seek2(s, stream_index, min_ts, ts, max_ts, flags);