Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Do not make assumtion that sc_stream_titles is initialize,

fixes crash when no stream title has been read during the
initial buffer fill.
  • Loading branch information...
commit 479b2409d257cac26f2716504ca28caedffbc1b5 1 parent 4096024
Henrik Andersson hean01 authored

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. +2 1  src/backend/shoutcast/shoutcast.c
3  src/backend/shoutcast/shoutcast.c
@@ -158,7 +158,7 @@ static int sc_avio_read_packet(void *opaque, uint8_t *buf, int buf_size)
158 158 rs = htsbuf_read(sc->sc_stream_buffer, buf, buf_size);
159 159
160 160 // update stream title if reached the point in buffer
161   - if (htsbuf_peek(sc->sc_stream_titles, &offs, sizeof(uint32_t)) != 0)
  161 + if (sc->sc_stream_titles && htsbuf_peek(sc->sc_stream_titles, &offs, sizeof(uint32_t)) != 0)
162 162 {
163 163 // TRACE(TRACE_DEBUG,"shoutcast", "We have stream titles on queue.");
164 164 if (sc->sc_stream_title_byte_offset == -1)
@@ -398,6 +398,7 @@ static int sc_initialize(sc_shoutcast_t *sc)
398 398 AVIOContext *probe;
399 399
400 400 sc->sc_stream_title_byte_offset = -1;
  401 + sc->sc_stream_titles = NULL;
401 402
402 403 sc->sc_fctx = avformat_alloc_context();
403 404

0 comments on commit 479b240

Please sign in to comment.
Something went wrong with that request. Please try again.