[FFmpeg-devel] [PATCH 2/3] avformat/oggparseogm: Fix undefined shift in ogm_packet()

Michael Niedermayer michael at niedermayer.cc
Fri Mar 9 03:37:53 EET 2018


Fixes: shift exponent 48 is too large for 32-bit type 'int'
Fixes: Chromium bug 786793
Reported-by: Matt Wolenetz <wolenetz at google.com>
Reviewed-by: Matt Wolenetz <wolenetz at google.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavformat/oggparseogm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/oggparseogm.c b/libavformat/oggparseogm.c
index ca6b62669d..4b4edf26ca 100644
--- a/libavformat/oggparseogm.c
+++ b/libavformat/oggparseogm.c
@@ -180,7 +180,7 @@ ogm_packet(AVFormatContext *s, int idx)
     os->psize -= lb + 1;
 
     while (lb--)
-        os->pduration += p[lb+1] << (lb*8);
+        os->pduration += (uint64_t)p[lb+1] << (lb*8);
 
     return 0;
 }
-- 
2.16.2



More information about the ffmpeg-devel mailing list