From e50e14dbfbc78ecca9366a47392907e37501fea6 Mon Sep 17 00:00:00 2001 From: Thibaut Mattern Date: Wed, 22 Sep 2004 20:54:44 +0000 Subject: Do not segfault if there is no seekpoint. CVS patchset: 6992 CVS date: 2004/09/22 20:54:44 --- src/demuxers/demux_flac.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/demuxers/demux_flac.c b/src/demuxers/demux_flac.c index d1f7057df..6d4b3bff0 100644 --- a/src/demuxers/demux_flac.c +++ b/src/demuxers/demux_flac.c @@ -23,7 +23,7 @@ * For more information on the FLAC file format, visit: * http://flac.sourceforge.net/ * - * $Id: demux_flac.c,v 1.6 2004/09/20 19:30:04 valtri Exp $ + * $Id: demux_flac.c,v 1.7 2004/09/22 20:54:44 tmattern Exp $ */ #ifdef HAVE_CONFIG_H @@ -308,6 +308,12 @@ static int demux_flac_seek (demux_plugin_t *this_gen, this->status = DEMUX_OK; } else { + if (this->seekpoints == NULL) { + /* cannot seek if there is no seekpoints */ + this->status = DEMUX_OK; + return this->status; + } + /* do a lazy, linear seek based on the assumption that there are not * that many seek points */ if (start_pos) { -- cgit v1.2.3