Vp3Fragment *all_fragments = s->all_fragments;
VLC_TYPE(*vlc_table)[2] = table->table;
- if (num_coeffs < 0)
+ if (num_coeffs < 0) {
av_log(s->avctx, AV_LOG_ERROR,
"Invalid number of coefficients at level %d\n", coeff_index);
+ return AVERROR_INVALIDDATA;
+ }
if (eob_run > num_coeffs) {
coeff_i =
if (eob_run_get_bits[token])
eob_run += get_bits(gb, eob_run_get_bits[token]);
+ if (!eob_run)
+ eob_run = INT_MAX;
+
// record only the number of blocks ended in this plane,
// any spill will be recorded in the next plane.
if (eob_run > num_coeffs - coeff_i) {