[FFmpeg-cvslog] avformat/oggparseopus: Fix Undefined behavior in oggparseopus.c and libavformat/utils.c

Thomas Guilbert git at videolan.org
Sun Jun 5 03:16:44 CEST 2016


ffmpeg | branch: release/3.0 | Thomas Guilbert <tguilbert at google.com> | Fri May 27 15:50:25 2016 -0700| [dab82a2a7c907f0ff842f9a1ce05670cfe6715ab] | committer: Michael Niedermayer

avformat/oggparseopus: Fix Undefined behavior in oggparseopus.c and libavformat/utils.c

Fixes: usan_granule_overflow

constant type fix by commiter
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 1a82d2cf8fb6a7e854e7548dfcf73c3d046b34ac)

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dab82a2a7c907f0ff842f9a1ce05670cfe6715ab
---

 libavformat/oggparseopus.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/oggparseopus.c b/libavformat/oggparseopus.c
index 584fff4..8bb2a41 100644
--- a/libavformat/oggparseopus.c
+++ b/libavformat/oggparseopus.c
@@ -117,7 +117,7 @@ static int opus_packet(AVFormatContext *avf, int idx)
 
     if (!os->psize)
         return AVERROR_INVALIDDATA;
-    if (os->granule > INT64_MAX - UINT32_MAX) {
+    if (os->granule > (1LL << 62)) {
         av_log(avf, AV_LOG_ERROR, "Unsupported huge granule pos %"PRId64 "\n", os->granule);
         return AVERROR_INVALIDDATA;
     }



More information about the ffmpeg-cvslog mailing list