History

avformat/apvdec: also look for an au_info PBU during probing

If present, an Access unit information PBU must be the first in an AU.

James Almer committed 1 year ago

Commit a0349d61 parent d08c5521 file · +18 −1Browse files

Unified · Split

libavformat/apvdec.c+18−1
@@ -51,7 +51,24 @@ static int apv_extract_header_info(GetByteContext *gbc) · 50 unmodified lines
5151 if (zero != 0)
5252 return AVERROR_INVALIDDATA;
5353
54− if (info->pbu_type != APV_PBU_PRIMARY_FRAME)
54+ if (info->pbu_type == APV_PBU_ACCESS_UNIT_INFORMATION) {
55+ unsigned int num_frames = bytestream2_get_be16(gbc);
56+ int pbu_type;
57+
58+ if (num_frames < 1)
59+ return AVERROR_INVALIDDATA;
60+
61+ info->pbu_type = bytestream2_get_byte(gbc);
62+ if (info->pbu_type != APV_PBU_PRIMARY_FRAME &&
63+ info->pbu_type != APV_PBU_NON_PRIMARY_FRAME &&
64+ (info->pbu_type < APV_PBU_PREVIEW_FRAME || info->pbu_type > APV_PBU_ALPHA_FRAME))
65+ return AVERROR_INVALIDDATA;
66+
67+ bytestream2_skip(gbc, 2); // group_id
68+ zero = bytestream2_get_byte(gbc);
69+ if (zero != 0)
70+ return AVERROR_INVALIDDATA;
71+ } else if (info->pbu_type != APV_PBU_PRIMARY_FRAME)
5572 return AVERROR_INVALIDDATA;
5673
5774 info->profile_idc = bytestream2_get_byte(gbc);

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