changeset 15217:d49091f2206c

integer overflow when reading fps from h264 vui.
author lorenm
date Tue, 19 Apr 2005 21:17:39 +0000
parents 15053e88fa42
children 090c8df3f6fe
files libmpdemux/mpeg_hdr.c libmpdemux/mpeg_hdr.h
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/mpeg_hdr.c	Tue Apr 19 06:48:33 2005 +0000
+++ b/libmpdemux/mpeg_hdr.c	Tue Apr 19 21:17:39 2005 +0000
@@ -286,7 +286,7 @@
     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,
--- a/libmpdemux/mpeg_hdr.h	Tue Apr 19 06:48:33 2005 +0000
+++ b/libmpdemux/mpeg_hdr.h	Tue Apr 19 21:17:39 2005 +0000
@@ -16,7 +16,7 @@
     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;