History

avcodec/cbs_vp8: Improve the bitstream position check

The VP8 compressed header may not be byte-aligned due to boolean coding. Round up byte count for accurate data positioning.

Dai, Jianhui J committed 2 years ago

Commit 61afe4d1 parent 63dea3c1 file · +3 −1Browse files

Unified · Split

libavcodec/cbs_vp8.c+3−1
@@ -339,7 +339,9 @@ static int cbs_vp8_read_unit(CodedBitstreamContext *ctx, · 338 unmodified lines
339339 return err;
340340
341341 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;
343345 av_assert0(pos <= unit->data_size);
344346
345347 frame->data_ref = av_buffer_ref(unit->data_ref);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t