aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-02 14:03:30 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-10 22:40:50 +0200
commit7a6b5d7a867ee2e9bab9f4cd7456085cc5833435 (patch)
treefed7a36bdcb03bf9f5853e83f4d858718bced203
parentfdfe94f4b16f70b6ca38dfd184795269906e9cf0 (diff)
downloadffmpeg-7a6b5d7a867ee2e9bab9f4cd7456085cc5833435.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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ffserver.c b/ffserver.c
index 08f7878541..fa04a54550 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)