for (i = 0; i < bits[p]; ++i)
exit_at_level[i+1] = 1 << i;
- #ifdef DEBUG
- av_log(NULL, AV_LOG_INFO, " %u. of %u code len %d code %d - ", p, num, bits[p], codes[p]);
- init_get_bits(&gb, (uint8_t *)&codes[p], bits[p]);
- for (i = 0; i < bits[p]; ++i)
- av_log(NULL, AV_LOG_INFO, "%s", get_bits1(&gb) ? "1" : "0");
- av_log(NULL, AV_LOG_INFO, "\n");
- #endif
-
++p;
+ for (i = p; (bits[i] == 0) && (i < num); ++i)
+ ;
+ if (i == num)
+ return 0;
+
for (; p < num; ++p) {
if (bits[p] > 32)
- return 1;
+ return AVERROR_INVALIDDATA;
if (bits[p] == 0)
continue;
// find corresponding exit(node which the tree can grow further from)