aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-01-12 18:49:20 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-01-15 16:00:31 +0100
commitf1cdd93517c8c7f2ed5956962c7e41528c063b1e (patch)
treefa48bdae3b0b3e40bb4a89f9ffb55f2c6afec0fc
parent0e3c36518d9920aebee0cfaf6a54d81ae5180666 (diff)
downloadffmpeg-f1cdd93517c8c7f2ed5956962c7e41528c063b1e.tar.gz
avformat/asfenc: Check pts
Fixes integer overflow Fixes: 0063df8be3aaa30dd6d76f59c8f818c8/signal_sigsegv_7b7b59_3634_bf418b6822bbfa68734411d96b667be3.mov Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 7c0b84d89911b2035161f5ef51aafbfcc84aa9e2) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/asfenc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c
index 015c731cec..6b4e794b24 100644
--- a/libavformat/asfenc.c
+++ b/libavformat/asfenc.c
@@ -927,6 +927,11 @@ static int asf_write_packet(AVFormatContext *s, AVPacket *pkt)
pts = (pkt->pts != AV_NOPTS_VALUE) ? pkt->pts : pkt->dts;
av_assert0(pts != AV_NOPTS_VALUE);
+ if ( pts < - PREROLL_TIME
+ || pts > (INT_MAX-3)/10000LL * ASF_INDEXED_INTERVAL - PREROLL_TIME) {
+ av_log(s, AV_LOG_ERROR, "input pts %"PRId64" is invalid\n", pts);
+ return AVERROR(EINVAL);
+ }
pts *= 10000;
asf->duration = FFMAX(asf->duration, pts + pkt->duration * 10000);