1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-15 14:13:16 +02:00

rtsp: Check a malloc return value

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Himangi Saraogi
2015-04-04 16:21:40 +05:30
committed by Martin Storsjö
parent bbdb50d7a8
commit 0b72a47f55

View File

@@ -2239,6 +2239,8 @@ static int sdp_read_header(AVFormatContext *s)
/* 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);