From 229b4f33d39377571a469afd4e3bf9db21e2b54c Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 1 Apr 2008 14:29:32 +0000 Subject: [PATCH] gst/asfdemux/gstasfdemux.c: Guard against division by 0 and fall back to 25/1 framerate. Original commit message from CVS: * gst/asfdemux/gstasfdemux.c: (gst_asf_demux_process_ext_stream_props): Guard against division by 0 and fall back to 25/1 framerate. --- ChangeLog | 6 ++++++ gst/asfdemux/gstasfdemux.c | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2a57c428a6..752f12dcc1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-04-01 Wim Taymans + + * gst/asfdemux/gstasfdemux.c: + (gst_asf_demux_process_ext_stream_props): + Guard against division by 0 and fall back to 25/1 framerate. + 2008-04-01 Wim Taymans * gst/asfdemux/gstasfdemux.c: (gst_asf_demux_add_video_stream), diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c index f80886f2a1..21a0e50247 100644 --- a/gst/asfdemux/gstasfdemux.c +++ b/gst/asfdemux/gstasfdemux.c @@ -2822,7 +2822,11 @@ done: g_value_init (&framerate, GST_TYPE_FRACTION); num = GST_SECOND / 100; - denom = esp.avg_time_per_frame; + denom = esp.avg_time_per_frame = 0; + if (denom == 0) { + /* avoid division by 0, assume 25/1 framerate */ + denom = GST_SECOND / 2500; + } gst_value_set_fraction (&framerate, num, denom);