*end = AV_NOPTS_VALUE;
get_word_sep(buf, sizeof(buf), "-", &p);
- av_parse_time(start, buf, 1);
+ if (av_parse_time(start, buf, 1) < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Invalid interval start specification '%s'\n", buf);
+ return;
+ }
if (*p == '-') {
p++;
get_word_sep(buf, sizeof(buf), "-", &p);
- av_parse_time(end, buf, 1);
+ if (av_parse_time(end, buf, 1) < 0)
+ av_log(NULL, AV_LOG_ERROR, "Invalid interval end specification '%s'\n", buf);
}
}
if (!st)
s->ctx_flags |= AVFMTCTX_NOHEADER;
- if (CONFIG_RTSP_MUXER && s->oformat) {
+ if (CONFIG_RTSP_MUXER && s->oformat && st) {
int ret = ff_rtp_chain_mux_open((AVFormatContext **)&rtsp_st->transport_priv,
s, st, rtsp_st->rtp_handle,
RTSP_TCP_MAX_PACKET_SIZE,
st->time_base = ((AVFormatContext*)rtsp_st->transport_priv)->streams[0]->time_base;
} else if (rt->transport == RTSP_TRANSPORT_RAW) {
return 0; // Don't need to open any parser here
- } else if (CONFIG_RTPDEC && rt->transport == RTSP_TRANSPORT_RDT)
+ } else if (CONFIG_RTPDEC && rt->transport == RTSP_TRANSPORT_RDT && st)
rtsp_st->transport_priv = ff_rdt_parse_open(s, st->index,
rtsp_st->dynamic_protocol_context,
rtsp_st->dynamic_handler);
/* read the whole sdp file */
/* XXX: better loading */
content = av_malloc(SDP_MAX_SIZE);
+ if (!content)
+ return AVERROR(ENOMEM);
size = avio_read(s->pb, content, SDP_MAX_SIZE - 1);
if (size <= 0) {
av_free(content);