]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/oggparseopus.c
avformat/avio: Fix null pointer dereference in case of memleak
[ffmpeg] / libavformat / oggparseopus.c
index 8191b1083ca2041fef387be76270d5a37a4b6161..99aa4398dd553bfb937313ee51cf4694d503b0fe 100644 (file)
@@ -117,6 +117,10 @@ static int opus_packet(AVFormatContext *avf, int idx)
 
     if (!os->psize)
         return AVERROR_INVALIDDATA;
+    if (os->granule > INT64_MAX - UINT32_MAX) {
+        av_log(avf, AV_LOG_ERROR, "Unsupported huge granule pos %"PRId64 "\n", os->granule);
+        return AVERROR_INVALIDDATA;
+    }
 
     if ((!os->lastpts || os->lastpts == AV_NOPTS_VALUE) && !(os->flags & OGG_FLAG_EOS)) {
         int seg, d;