diff mbox

[FFmpeg-devel] avcodec/mpeg4videoenc: Use 64 bit for times in mpeg4_encode_gop_header()

Message ID 20180521213051.21993-1-michael@niedermayer.cc
State Accepted
Commit e1182fac1afba92a4975917823a5f644bee7e6e8
Headers show

Commit Message

Michael Niedermayer May 21, 2018, 9:30 p.m. UTC
Fixes truncation
Fixes Assertion n <= 31 && value < (1U << n) failed at libavcodec/put_bits.h:169
Fixes: ffmpeg_crash_2.avi

Found-by: Thuan Pham <thuanpv@comp.nus.edu.sg>, Marcel Böhme, Andrew Santosa and Alexandru RazvanCaciulescu with AFLSmart

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/mpeg4videoenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer May 27, 2018, 8:01 p.m. UTC | #1
On Mon, May 21, 2018 at 11:30:51PM +0200, Michael Niedermayer wrote:
> Fixes truncation
> Fixes Assertion n <= 31 && value < (1U << n) failed at libavcodec/put_bits.h:169
> Fixes: ffmpeg_crash_2.avi
> 
> Found-by: Thuan Pham <thuanpv@comp.nus.edu.sg>, Marcel Böhme, Andrew Santosa and Alexandru RazvanCaciulescu with AFLSmart
> 
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/mpeg4videoenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

[...]
diff mbox

Patch

diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c
index 494452c938..f6a5992df7 100644
--- a/libavcodec/mpeg4videoenc.c
+++ b/libavcodec/mpeg4videoenc.c
@@ -882,7 +882,7 @@  void ff_set_mpeg4_time(MpegEncContext *s)
 
 static void mpeg4_encode_gop_header(MpegEncContext *s)
 {
-    int hours, minutes, seconds;
+    int64_t hours, minutes, seconds;
     int64_t time;
 
     put_bits(&s->pb, 16, 0);