summaryrefslogtreecommitdiff
path: root/libavcodec/wma.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-05-06 17:08:44 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-05-12 06:00:13 +0200
commitcb8f01951b3e594f754d4d240f66cc01d6881e4d (patch)
treebc9dec8b599d1f7e7561afcc7d6de5d601d7ed25 /libavcodec/wma.c
parentfcdb012a100b245890949b2d53cb7f042380787d (diff)
avcodec/wma: Check initializing VLC
Initializing a VLC entails implicit allocations which may fail. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/wma.c')
-rw-r--r--libavcodec/wma.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/wma.c b/libavcodec/wma.c
index ee04ef725f..004ffb5515 100644
--- a/libavcodec/wma.c
+++ b/libavcodec/wma.c
@@ -41,9 +41,11 @@ static av_cold int init_coef_vlc(VLC *vlc, uint16_t **prun_table,
const uint16_t *levels_table = vlc_table->levels;
uint16_t *run_table, *int_table;
float *flevel_table;
- int i, l, j, k, level;
+ int i, l, j, k, level, ret;
- init_vlc(vlc, VLCBITS, n, table_bits, 1, 1, table_codes, 4, 4, 0);
+ ret = init_vlc(vlc, VLCBITS, n, table_bits, 1, 1, table_codes, 4, 4, 0);
+ if (ret < 0)
+ return ret;
run_table = av_malloc_array(n, sizeof(uint16_t));
flevel_table = av_malloc_array(n, sizeof(*flevel_table));