avcodec/cbs_h2645: Check NAL space

Found-by-reviewing: CID1419833 Untrusted loop bound

Sponsored-by: Sovereign Tech Fund
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 02301017
......@@ -709,7 +709,11 @@ static int cbs_h2645_split_fragment(CodedBitstreamContext *ctx,
start = bytestream2_tell(&gbc);
for(i = 0; i < num_nalus; i++) {
if (bytestream2_get_bytes_left(&gbc) < 2)
return AVERROR_INVALIDDATA;
size = bytestream2_get_be16(&gbc);
if (bytestream2_get_bytes_left(&gbc) < size)
return AVERROR_INVALIDDATA;
bytestream2_skip(&gbc, size);
}
end = bytestream2_tell(&gbc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment