aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-08-03 13:34:40 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-08-23 13:15:16 +0200
commit68d22a7caaa8ffd4b103932fa8954af047dc9207 (patch)
tree4a73ec8a2f3346115d3b210318b990f9c30b7aa8
parent94fb2fba763e6261c3c57f03002a0742226aee29 (diff)
downloadffmpeg-68d22a7caaa8ffd4b103932fa8954af047dc9207.tar.gz
avformat/oggdec: Fix integer overflow with invalid pts
If negative pts are possible for some codecs in ogg then the code needs to be changed to use signed values. Found-by: Thomas Guilbert <tguilbert@google.com> Fixes: clusterfuzz_usan-2016-08-02 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit c5cc3b08e56fc95665977544486bd9f06e4b7a72) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/oggdec.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/oggdec.h b/libavformat/oggdec.h
index 7dc7716036..c52604f644 100644
--- a/libavformat/oggdec.h
+++ b/libavformat/oggdec.h
@@ -161,6 +161,11 @@ ogg_gptopts (AVFormatContext * s, int i, uint64_t gp, int64_t *dts)
if (dts)
*dts = pts;
}
+ if (pts > INT64_MAX && pts != AV_NOPTS_VALUE) {
+ // The return type is unsigned, we thus cannot return negative pts
+ av_log(s, AV_LOG_ERROR, "invalid pts %"PRId64"\n", pts);
+ pts = AV_NOPTS_VALUE;
+ }
return pts;
}