summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2015-11-18 16:10:11 +0100
committerSebastian Dröge <sebastian@centricular.com>2015-12-01 20:10:19 +0200
commit4c50ad0e27bfc431541897507c2bc6b90080aac7 (patch)
tree3412116feb0855062d4eda73069980468f923e2d
parentb208ae72eeaf80fae3cbbb3799cbbc37da2c8164 (diff)
avimux: don't crash if we never got audio caps before stopping
auds.blockalign is set once the first caps arrive. If gst_avi_mux_stop_file() is called before this happens then auds.blockalign is zero and gst_avi_mux_audsink_set_fields() cause a crash: [...] avipad->parent.hdr.rate = avipad->auds.av_bps / avipad->auds.blockalign; [...] https://bugzilla.gnome.org/show_bug.cgi?id=758912
-rw-r--r--gst/avi/gstavimux.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gst/avi/gstavimux.c b/gst/avi/gstavimux.c
index 2ef3d3e0d..ddfac1309 100644
--- a/gst/avi/gstavimux.c
+++ b/gst/avi/gstavimux.c
@@ -1824,6 +1824,8 @@ gst_avi_mux_stop_file (GstAviMux * avimux)
/* housekeeping for vbr case */
if (audpad->max_audio_chunk)
audpad->auds.blockalign = audpad->max_audio_chunk;
+ if (audpad->auds.blockalign == 0)
+ audpad->auds.blockalign = 1;
gst_avi_mux_audsink_set_fields (avimux, audpad);
avimux->avi_hdr.max_bps += audpad->auds.av_bps;
avipad->hdr.length = gst_util_uint64_scale (audpad->audio_time,