History

lavc/cbs_h2645: Fix incorrect max size of nalu unit

In the worst case the startcode prefix has 4 bytes. This fixes a trigerred assertion: Assertion dp <= max_size failed at libavcodec/cbs_h2645.c:1451

Andriy Gelman committed 6 years ago

Commit 02a83e21 parent 79d90771 file · +1 −1Browse files

Unified · Split

libavcodec/cbs_h2645.c+1−1
@@ -1395,7 +1395,7 @@ static int cbs_h2645_assemble_fragment(CodedBitstreamContext *ctx, · 1394 unmodified lines
1395 max_size = 0;1395 max_size = 0;
1396 for (i = 0; i < frag->nb_units; i++) {1396 for (i = 0; i < frag->nb_units; i++) {
1397 // Start code + content with worst-case emulation prevention.1397 // Start code + content with worst-case emulation prevention.
1398 max_size += 3 + frag->units[i].data_size * 3 / 2;1398 max_size += 4 + frag->units[i].data_size * 3 / 2;
1399 }1399 }
1400 1400
1401 data = av_realloc(NULL, max_size + AV_INPUT_BUFFER_PADDING_SIZE);1401 data = av_realloc(NULL, max_size + AV_INPUT_BUFFER_PADDING_SIZE);

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