From a1882f48beee0c1b6750ec03f8b133e7325057a9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 30 Jun 2010 23:38:49 +0200 Subject: [PATCH] decoder/vorbis: handle uri==NULL This fixes a theoretical crash, which has never occurred in practice. --- NEWS | 1 + src/decoder/vorbis_plugin.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/NEWS b/NEWS index 14465cad5..fac8ec6fd 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ ver 0.15.11 (2010/??/??) * decoders: - mp4ff: support tags "album artist", "albumartist", "band" - mikmod: fix memory leak + - vorbis: handle uri==NULL - ffmpeg: free AVFormatContext on error - ffmpeg: read more metadata * playlist: emit IDLE_OPTIONS when resetting single mode diff --git a/src/decoder/vorbis_plugin.c b/src/decoder/vorbis_plugin.c index 3da56bd5c..7c782a779 100644 --- a/src/decoder/vorbis_plugin.c +++ b/src/decoder/vorbis_plugin.c @@ -233,6 +233,9 @@ oggvorbis_seekable(struct decoder *decoder) bool seekable; uri = decoder_get_uri(decoder); + if (uri == NULL) + return false; + /* disable seeking on remote streams, because libvorbis seeks around like crazy, and due to being very expensive, this delays song playback my 10 or 20 seconds */