aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/bitstream.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-05-30 23:26:09 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-05-30 23:26:09 +0000
commitb9c8388710a06544812739eedc0a40d3451491dc (patch)
treebca91bb971bda6cb0fe6c2c66cfd80501140aa0b /libavcodec/bitstream.c
parent83422c1940d963d395a64bee0cbb9c637192ce8c (diff)
downloadffmpeg-b9c8388710a06544812739eedc0a40d3451491dc.tar.gz
As *_static are not deallocated anymore except on program termination
we do not need to keep track of them anymore. Fixes CID117 RUN2 and various race conditions. Originally committed as revision 13571 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/bitstream.c')
-rw-r--r--libavcodec/bitstream.c28
1 files changed, 2 insertions, 26 deletions
diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c
index 78d7f1b56c..d39980f4df 100644
--- a/libavcodec/bitstream.c
+++ b/libavcodec/bitstream.c
@@ -42,38 +42,14 @@
attribute_deprecated av_alloc_size(2)
static void *ff_realloc_static(void *ptr, unsigned int size);
-static unsigned int last_static = 0;
-static unsigned int allocated_static = 0;
-static void** array_static = NULL;
-
static void *av_mallocz_static(unsigned int size)
{
- void *ptr = av_mallocz(size);
-
- if(ptr){
- array_static =av_fast_realloc(array_static, &allocated_static, sizeof(void*)*(last_static+1));
- if(!array_static)
- return NULL;
- array_static[last_static++] = ptr;
- }
-
- return ptr;
+ return av_mallocz(size);
}
static void *ff_realloc_static(void *ptr, unsigned int size)
{
- int i;
- if(!ptr)
- return av_mallocz_static(size);
- /* Look for the old ptr */
- for(i = 0; i < last_static; i++) {
- if(array_static[i] == ptr) {
- array_static[i] = av_realloc(array_static[i], size);
- return array_static[i];
- }
- }
- return NULL;
-
+ return av_realloc(ptr, size);
}
void align_put_bits(PutBitContext *s)