summaryrefslogtreecommitdiff
path: root/ffserver.c
diff options
context:
space:
mode:
authorRoman Shaposhnik <roman@shaposhnik.org>2003-01-23 22:00:57 +0000
committerFabrice Bellard <fabrice@bellard.org>2003-01-23 22:00:57 +0000
commit98486a6bc01288a0ac46ae8d54940a994972b90e (patch)
tree368b6b88e3c331d08da63e82a9ff129bb4ef1c27 /ffserver.c
parenta5df11ab1e0e2c4bc4218a6543f6dfaf7169d4e4 (diff)
zero sized malloc patch by Roman Shaposhnick
Originally committed as revision 1501 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffserver.c')
-rw-r--r--ffserver.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ffserver.c b/ffserver.c
index e003a9e0ad..9461e92c07 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2457,9 +2457,12 @@ static int http_receive_data(HTTPContext *c)
if (!fmt_in)
goto fail;
- s.priv_data = av_mallocz(fmt_in->priv_data_size);
- if (!s.priv_data)
- goto fail;
+ if (fmt_in->priv_data_size > 0) {
+ s.priv_data = av_mallocz(fmt_in->priv_data_size);
+ if (!s.priv_data)
+ goto fail;
+ } else
+ s.priv_data = NULL;
if (fmt_in->read_header(&s, 0) < 0) {
av_freep(&s.priv_data);