summaryrefslogtreecommitdiff
path: root/libavcodec/bitstream.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/bitstream.c')
-rw-r--r--libavcodec/bitstream.c6
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;
}