X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fbitstream.c;h=35f775437df8e791589a6dd941fa3cc224604dc2;hb=387afa9d01edf508232972195cb185624d5e4ea4;hp=22d256df51a7be4737350aa3a49c73bd33f69dd5;hpb=b78e7197a81e193827cf2408fe25bc1f14843a72;p=ffmpeg diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c index 22d256df51a..35f775437df 100644 --- a/libavcodec/bitstream.c +++ b/libavcodec/bitstream.c @@ -30,6 +30,15 @@ #include "avcodec.h" #include "bitstream.h" +/** + * Same as av_mallocz_static(), but does a realloc. + * + * @param[in] ptr The block of memory to reallocate. + * @param[in] size The requested size. + * @return Block of memory of requested size. + */ +void *ff_realloc_static(void *ptr, unsigned int size); + void align_put_bits(PutBitContext *s) { #ifdef ALT_BITSTREAM_WRITER @@ -78,7 +87,7 @@ static int alloc_table(VLC *vlc, int size, int use_static) if (vlc->table_size > vlc->table_allocated) { vlc->table_allocated += (1 << vlc->bits); if(use_static) - vlc->table = av_realloc_static(vlc->table, + vlc->table = ff_realloc_static(vlc->table, sizeof(VLC_TYPE) * 2 * vlc->table_allocated); else vlc->table = av_realloc(vlc->table,