The VP8 compressed header may not be byte-aligned due to boolean coding. Round up byte count for accurate data positioning.
Unified · Split
| @@ -339,7 +339,9 @@ static int cbs_vp8_read_unit(CodedBitstreamContext *ctx, · 338 unmodified lines | |||
| 339 | return err; | 339 | return err; |
| 340 | 340 | ||
| 341 | pos = get_bits_count(&gbc); | 341 | pos = get_bits_count(&gbc); |
| 342 | pos /= 8; | 342 | // Position may not be byte-aligned after compressed header; Round up byte |
| 343 | // count for accurate data positioning. | ||
| 344 | pos = (pos + 7) / 8; | ||
| 343 | av_assert0(pos <= unit->data_size); | 345 | av_assert0(pos <= unit->data_size); |
| 344 | 346 | ||
| 345 | frame->data_ref = av_buffer_ref(unit->data_ref); | 347 | frame->data_ref = av_buffer_ref(unit->data_ref); |