From f3bf706a77be09cc37bd46967abdad286cd20eec Mon Sep 17 00:00:00 2001 From: lorenm Date: Tue, 19 Apr 2005 21:17:39 +0000 Subject: [PATCH] integer overflow when reading fps from h264 vui. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15218 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/mpeg_hdr.c | 2 +- libmpdemux/mpeg_hdr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libmpdemux/mpeg_hdr.c b/libmpdemux/mpeg_hdr.c index c8867d4ea0..31d1c5207a 100644 --- a/libmpdemux/mpeg_hdr.c +++ b/libmpdemux/mpeg_hdr.c @@ -286,7 +286,7 @@ static int h264_parse_vui(mp_mpeg_header_t * picture, unsigned char * buf, unsig fixed_fps = getbits(buf, n, 1); if(picture->timeinc_unit > 0 && picture->timeinc_resolution > 0) - picture->fps = (picture->timeinc_resolution * 10000) / picture->timeinc_unit; + picture->fps = ((uint64_t)picture->timeinc_resolution * 10000) / picture->timeinc_unit; } //fprintf(stderr, "H264_PARSE_VUI, OVESCAN=%u, VSP_COLOR=%u, CHROMA=%u, TIMING=%u, DISPW=%u, DISPH=%u, TIMERES=%u, TIMEINC=%u, FIXED_FPS=%u\n", overscan, vsp_color, chroma, timing, picture->display_picture_width, picture->display_picture_height, diff --git a/libmpdemux/mpeg_hdr.h b/libmpdemux/mpeg_hdr.h index c1097b1d51..7eb3c4b9be 100644 --- a/libmpdemux/mpeg_hdr.h +++ b/libmpdemux/mpeg_hdr.h @@ -16,7 +16,7 @@ typedef struct { int top_field_first; int display_time; // secs*100 //the following are for mpeg4 - int timeinc_resolution, timeinc_bits, timeinc_unit; + unsigned int timeinc_resolution, timeinc_bits, timeinc_unit; int picture_type; } mp_mpeg_header_t;