diff --git a/libavformat/sapdec.c b/libavformat/sapdec.c index d5b5d71c02..22db3803c9 100644 --- a/libavformat/sapdec.c +++ b/libavformat/sapdec.c @@ -179,7 +179,9 @@ static int sap_read_header(AVFormatContext *s) goto fail; } st->id = i; - avcodec_parameters_copy(st->codecpar, sap->sdp_ctx->streams[i]->codecpar); + ret = avcodec_parameters_copy(st->codecpar, sap->sdp_ctx->streams[i]->codecpar); + if (ret < 0) + goto fail; st->time_base = sap->sdp_ctx->streams[i]->time_base; }