diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-08-02 14:03:30 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-08-02 18:32:37 +0200 |
commit | 1d8d21b90ab91aa471f369e0f9d1ea20fb40733b (patch) | |
tree | c2cf8f789ba25ced8945057a7a6474a20180b86a /ffserver.c | |
parent | e706fe764049b3f1ccf10ba9f686426a4c007906 (diff) | |
download | ffmpeg-1d8d21b90ab91aa471f369e0f9d1ea20fb40733b.tar.gz |
ffserver: initialize pbuffer in prepare_sdp_description()
also check pbuffer before use
Found-by: CSA
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffserver.c')
-rw-r--r-- | ffserver.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ffserver.c b/ffserver.c index 00153b44ae..956d9f5172 100644 --- a/ffserver.c +++ b/ffserver.c @@ -2977,6 +2977,8 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer, AVDictionaryEntry *entry = av_dict_get(stream->metadata, "title", NULL, 0); int i; + *pbuffer = NULL; + avc = avformat_alloc_context(); if (avc == NULL || !rtp_format) { return -1; @@ -3013,7 +3015,7 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer, av_free(avc); av_free(avs); - return strlen(*pbuffer); + return *pbuffer ? strlen(*pbuffer) : AVERROR(ENOMEM); } static void rtsp_cmd_options(HTTPContext *c, const char *url) |