[FFmpeg-cvslog] r21715 - in branches/0.5: . libavcodec/h264.c

siretart subversion
Tue Feb 9 20:02:40 CET 2010


Author: siretart
Date: Tue Feb  9 20:02:39 2010
New Revision: 21715

Log:
Check num_units_in_tick/time_scale to be valid and within the range we support.
based on a patch by chrome

backported r19979 by michael

Modified:
   branches/0.5/   (props changed)
   branches/0.5/libavcodec/h264.c

Modified: branches/0.5/libavcodec/h264.c
==============================================================================
--- branches/0.5/libavcodec/h264.c	Tue Feb  9 19:59:34 2010	(r21714)
+++ branches/0.5/libavcodec/h264.c	Tue Feb  9 20:02:39 2010	(r21715)
@@ -7016,6 +7016,10 @@ static inline int decode_vui_parameters(
     if(sps->timing_info_present_flag){
         sps->num_units_in_tick = get_bits_long(&s->gb, 32);
         sps->time_scale = get_bits_long(&s->gb, 32);
+        if(sps->num_units_in_tick-1 > 0x7FFFFFFEU || sps->time_scale-1 > 0x7FFFFFFEU){
+            av_log(h->s.avctx, AV_LOG_ERROR, "time_scale/num_units_in_tick inavlid or unsupported (%d/%d)\n", sps->time_scale, sps->num_units_in_tick);
+            return -1;
+        }
         sps->fixed_frame_rate_flag = get_bits1(&s->gb);
     }
 



More information about the ffmpeg-cvslog mailing list