diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-12-09 20:31:29 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-12-09 20:31:29 +0100 |
commit | 8c677a9f06c5d145da0301cdc3c6bff9ebacb5d7 (patch) | |
tree | 9c756ade47cc06771cb120f53b5f9c22724717f6 /libavcodec/bitstream.c | |
parent | 94a849b8b6c3e4a90361485b2e12a9a5c35833a3 (diff) | |
parent | 9b8d11a76ae7bca8bbb58abb822138f8b42c776c (diff) | |
download | ffmpeg-8c677a9f06c5d145da0301cdc3c6bff9ebacb5d7.tar.gz |
Merge commit '9b8d11a76ae7bca8bbb58abb822138f8b42c776c'
* commit '9b8d11a76ae7bca8bbb58abb822138f8b42c776c':
avcodec: Use av_reallocp where suitable
Conflicts:
libavcodec/bitstream.c
libavcodec/eatgv.c
libavcodec/flashsv.c
libavcodec/libtheoraenc.c
libavcodec/libvpxenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/bitstream.c')
-rw-r--r-- | libavcodec/bitstream.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c index 299ee23b4a..1a346266ec 100644 --- a/libavcodec/bitstream.c +++ b/libavcodec/bitstream.c @@ -108,12 +108,16 @@ static int alloc_table(VLC *vlc, int size, int use_static) vlc->table_size += size; if (vlc->table_size > vlc->table_allocated) { + int err; if (use_static) abort(); // cannot do anything, init_vlc() is used with too little memory vlc->table_allocated += (1 << vlc->bits); vlc->table = av_realloc_f(vlc->table, vlc->table_allocated, sizeof(VLC_TYPE) * 2); - if (!vlc->table) + if (!vlc->table) { + vlc->table_allocated = 0; + vlc->table_size = 0; return AVERROR(ENOMEM); + } } return index; } |