History

avcodec/hevc_parse: restrict configurationVersion to 0 and 1

The standard only defined configurationVersion 1. configurationVersion 0 is for backward compatibility predates the standard. This patch reduces the chance that some malformated streams being detected as hvcC.

Zhao Zhili committed 3 years ago

Commit 372f71c1 parent 50f34171 file · +5 −5Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/hevc_parse.c+5−5
@@ -86,11 +86,11 @@ int ff_hevc_decode_extradata(const uint8_t *data, int size, HEVCParamSets *ps, · 85 unmodified lines
8686
8787 bytestream2_init(&gb, data, size);
8888
89− if (size > 3 && (data[0] || data[1] || data[2] > 1)) {
90− /* It seems the extradata is encoded as hvcC format.
91− * Temporarily, we support configurationVersion==0 until 14496-15 3rd
92− * is finalized. When finalized, configurationVersion will be 1 and we
93− * can recognize hvcC by checking if avctx->extradata[0]==1 or not. */
89+ /* data[0] == 1 is configurationVersion from 14496-15.
90+ * data[0] == 0 is for backward compatibility predates the standard.
91+ */
92+ if (size > 3 && ((data[0] == 1) || (data[0] == 0 && (data[1] || data[2] > 1)))) {
93+ /* It seems the extradata is encoded as hvcC format. */
9494 int i, j, num_arrays, nal_len_size;
9595
9696 *is_nalff = 1;

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