avformat/rtsp: Fix null pointer dereference

This fixes CID 1257827.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/130/head
Himangi Saraogi 10 years ago committed by Michael Niedermayer
parent f0c85d9b99
commit 4b03002527
  1. 2
      libavformat/rtsp.c

@ -2259,6 +2259,8 @@ static int sdp_read_header(AVFormatContext *s)
/* read the whole sdp file */ /* read the whole sdp file */
/* XXX: better loading */ /* XXX: better loading */
content = av_malloc(SDP_MAX_SIZE); content = av_malloc(SDP_MAX_SIZE);
if (!content)
return AVERROR(ENOMEM);
size = avio_read(s->pb, content, SDP_MAX_SIZE - 1); size = avio_read(s->pb, content, SDP_MAX_SIZE - 1);
if (size <= 0) { if (size <= 0) {
av_free(content); av_free(content);

Loading…
Cancel
Save