mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-03 15:06:34 +00:00
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
This commit is contained in:
parent
b208ae72ee
commit
4c50ad0e27
1 changed files with 2 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue