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-05 04:45:56 +0200
commit119131fcbfdca9eda0b18d2de8401ad07e616324 (patch)
tree4dfb6a3abf3d32b1fae0eb2b427b327e39617cab
parentc13e38bac7e78cbf016749e3d320cd622f6f1f45 (diff)
downloadffmpeg-119131fcbfdca9eda0b18d2de8401ad07e616324.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 c2d2180e8c..d0038e6d43 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2989,6 +2989,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;
@@ -3025,7 +3027,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)