Skip to content

Commit

Permalink
avcodec/mpeg4videoenc: Use 64 bit for times in mpeg4_encode_gop_header()
Browse files Browse the repository at this point in the history
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>
(cherry picked from commit e1182fa)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
  • Loading branch information
michaelni committed Jul 9, 2018
1 parent 3d4e085 commit 6bbef93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libavcodec/mpeg4videoenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,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);
Expand Down

0 comments on commit 6bbef93

Please sign in to comment.