bitstream: Replace check for impossible condition by assertion.
authorAndre Noll <maan@systemlinux.org>
Sat, 28 Dec 2013 17:16:18 +0000 (17:16 +0000)
committerAndre Noll <maan@systemlinux.org>
Tue, 22 Apr 2014 00:26:43 +0000 (02:26 +0200)
No big deal because behaviour is unchanged (abort). Calling assert()
is a bit shorter and will print a better error message.

bitstream.c

index 8f13a9b..492b407 100644 (file)
@@ -88,10 +88,7 @@ static int build_table(struct vlc *vlc, int table_nb_bits, int nb_codes,
                        j = (code << (table_nb_bits - n)) & (table_size - 1);
                        nb = 1 << (table_nb_bits - n);
                        for (k = 0; k < nb; k++) {
-                               if (table[j][1] /* bits */ != 0) {
-                                       PARA_EMERG_LOG("incorrect code\n");
-                                       exit(EXIT_FAILURE);
-                               }
+                               assert(table[j][1] == 0); /* incorrect code */
                                table[j][1] = n; /* bits */
                                table[j][0] = i;
                                j++;