num_lens = get_bits(gb, 5);
if (num_lens > VLC_BITS * VLC_DEPTH) {
- vlc->table = NULL;
-
av_log(ctx->avctx, AV_LOG_ERROR, "To long VLCs %d\n", num_lens);
return AVERROR_INVALIDDATA;
}
num_codes_sum += num_codes;
if (num_codes_sum > 256) {
- vlc->table = NULL;
-
av_log(ctx->avctx, AV_LOG_ERROR,
"Too many VLCs (%d) to be read.\n", num_codes_sum);
return AVERROR_INVALIDDATA;
count++;
}
if (prefix > (65535 - 256)/2) {
- vlc->table = NULL;
return AVERROR_INVALIDDATA;
}
for (i = 0; i < 4; i++) {
ret = read_code_table(ctx, gb, &vlc[i]);
if (ret < 0) {
- for (j = 0; j <= i; j++)
+ for (j = 0; j < i; j++)
ff_free_vlc(&vlc[j]);
av_log(ctx->avctx, AV_LOG_ERROR,
for (i = 0; i < 3; i++) {
ret = read_code_table(ctx, gb, &vlc[i]);
if (ret < 0) {
- for (j = 0; j <= i; j++)
+ for (j = 0; j < i; j++)
ff_free_vlc(&vlc[j]);
av_log(ctx->avctx, AV_LOG_ERROR,
for (i = 0; i < 2; i++) {
ret = read_code_table(ctx, gb, &vlc[i]);
if (ret < 0) {
- for (j = 0; j <= i; j++)
+ for (j = 0; j < i; j++)
ff_free_vlc(&vlc[j]);
av_log(ctx->avctx, AV_LOG_ERROR,