diff options
author | Mark Hills <mark@pogo.org.uk> | 2003-03-26 10:30:08 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-03-26 10:30:08 +0000 |
commit | b88ba823153f3a2f5587c439404d66fdbfc68339 (patch) | |
tree | 6100ee5fb1c262ca959323ad55c771ad3267fe61 /libavformat/aviobuf.c | |
parent | 06219cb194e64eb1c0c495e147496c51212dd301 (diff) | |
download | ffmpeg-b88ba823153f3a2f5587c439404d66fdbfc68339.tar.gz |
ffserver deallocate ctx->streams on closing patch by (Mark Hills <mark at pogo dot org dot uk>)
Originally committed as revision 1704 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/aviobuf.c')
-rw-r--r-- | libavformat/aviobuf.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index fc1ae2c64f..11d00f239d 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -569,12 +569,9 @@ static void dyn_buf_write(void *opaque, uint8_t *buf, int buf_size) } if (new_allocated_size > d->allocated_size) { - new_buffer = av_malloc(new_allocated_size); - if (!new_buffer) - return; - memcpy(new_buffer, d->buffer, d->size); - av_free(d->buffer); - d->buffer = new_buffer; + d->buffer = av_realloc(d->buffer, new_allocated_size); + if(d->buffer == NULL) + return ; d->allocated_size = new_allocated_size; } memcpy(d->buffer + d->pos, buf, buf_size); |