]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - bitstream.c
string: Introduce arr_realloc() and check for integer overflow.
[paraslash.git] / bitstream.c
index dfc1e55e67aced611014fc90b86128e8bd61a457..a1c7c943138d41993807109be09969a58e914a0b 100644 (file)
@@ -46,8 +46,8 @@ static void alloc_table(struct vlc *vlc, int size)
        vlc->table_size += size;
        if (vlc->table_size > vlc->table_allocated) {
                vlc->table_allocated += (1 << vlc->bits);
-               vlc->table = para_realloc(vlc->table,
-                       sizeof(int16_t) * 2 * vlc->table_allocated);
+               vlc->table = arr_realloc(vlc->table, vlc->table_allocated,
+                       sizeof(int16_t) * 2);
        }
 }