diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-08-02 14:03:30 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-11-28 18:44:37 +0100 |
commit | 150ae7692efc5890b944699534904af378c06711 (patch) | |
tree | 27fa79a7194c79d7b09b948847dcec7296a6de97 | |
parent | 7d69132775e643963ddcc67f75e58d65a66d3e58 (diff) | |
download | ffmpeg-150ae7692efc5890b944699534904af378c06711.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>
(cherry picked from commit 1d8d21b90ab91aa471f369e0f9d1ea20fb40733b)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | ffserver.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ffserver.c b/ffserver.c index 5ecdb08d38..44f843eb4b 100644 --- a/ffserver.c +++ b/ffserver.c @@ -2972,6 +2972,8 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer, AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL); int i; + *pbuffer = NULL; + avc = avformat_alloc_context(); if (avc == NULL || !rtp_format) { return -1; @@ -3008,7 +3010,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) |