]> git.sesse.net Git - vlc/commitdiff
input/control.c: fix diviton by zero on selection bytebased bookmarks in live streams
authorSigmund Augdal Helberg <sigmunau@videolan.org>
Sat, 5 Feb 2005 12:33:27 +0000 (12:33 +0000)
committerSigmund Augdal Helberg <sigmunau@videolan.org>
Sat, 5 Feb 2005 12:33:27 +0000 (12:33 +0000)
src/input/control.c

index 4b3cec6e839464e703df728e62e1bdbf5258c770..25f5052c307aaa397aa71a68a33514c545a21c68 100644 (file)
@@ -391,6 +391,12 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
                 }
                 else if( p_input->bookmark[i_bkmk]->i_byte_offset )
                 {
+                    // don't crash on bookmarks in live streams
+                    if( stream_Size( p_input->input.p_stream ) == 0 )
+                    {
+                        vlc_mutex_unlock( &p_input->input.p_item->lock );
+                        return VLC_EGENERIC;
+                    }
                     pos.f_float = !p_input->input.p_stream ? 0 :
                         p_input->bookmark[i_bkmk]->i_byte_offset /
                         stream_Size( p_input->input.p_stream );