summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMark Hills <mark@pogo.org.uk>2003-03-26 10:30:08 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-03-26 10:30:08 +0000
commitb88ba823153f3a2f5587c439404d66fdbfc68339 (patch)
tree6100ee5fb1c262ca959323ad55c771ad3267fe61 /libavformat
parent06219cb194e64eb1c0c495e147496c51212dd301 (diff)
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')
-rw-r--r--libavformat/aviobuf.c9
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);