You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avformat/rtsp: check memory allocation
Reviewed-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de> Commit message by: Benoit Fouet <benoit.fouet@free.fr> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
committed by
Michael Niedermayer
parent
8a95379990
commit
c69f230a3a
@@ -1150,6 +1150,8 @@ start:
|
|||||||
if (content_length > 0) {
|
if (content_length > 0) {
|
||||||
/* leave some room for a trailing '\0' (useful for simple parsing) */
|
/* leave some room for a trailing '\0' (useful for simple parsing) */
|
||||||
content = av_malloc(content_length + 1);
|
content = av_malloc(content_length + 1);
|
||||||
|
if (!content)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
ffurl_read_complete(rt->rtsp_hd, content, content_length);
|
ffurl_read_complete(rt->rtsp_hd, content, content_length);
|
||||||
content[content_length] = '\0';
|
content[content_length] = '\0';
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user