git.videolan.org
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bbdb50d
)
rtsp: Check a malloc return value
author
Himangi Saraogi
<himangi774@gmail.com>
Sat, 4 Apr 2015 10:51:40 +0000
(16:21 +0530)
committer
Martin Storsjö
<martin@martin.st>
Sun, 12 Apr 2015 20:08:13 +0000
(23:08 +0300)
Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/rtsp.c
patch
|
blob
|
history
diff --git
a/libavformat/rtsp.c
b/libavformat/rtsp.c
index
1c2c555
..
3246718
100644
(file)
--- a/
libavformat/rtsp.c
+++ b/
libavformat/rtsp.c
@@
-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);
/* 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);
size = avio_read(s->pb, content, SDP_MAX_SIZE - 1);
if (size <= 0) {
av_free(content);