1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avformat/evc: skip nalu header size bytes before parsing sps

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2023-06-19 17:01:41 -03:00
parent 048b8bdd5e
commit e81eafcb97
2 changed files with 8 additions and 1 deletions

View File

@ -120,6 +120,9 @@ static int evcc_parse_sps(const uint8_t *bs, int bs_size, EVCDecoderConfiguratio
int sps_seq_parameter_set_id;
EVCSPS sps;
bs += EVC_NALU_HEADER_SIZE;
bs_size -= EVC_NALU_HEADER_SIZE;
if (init_get_bits8(&gb, bs, bs_size) < 0)
return 0;
@ -368,6 +371,10 @@ int ff_isom_write_evcc(AVIOContext *pb, const uint8_t *data,
if (bytes_to_read < nalu_size) break;
nalu_type = evc_get_nalu_type(data, bytes_to_read, pb);
if (nalu_type < EVC_NOIDR_NUT || nalu_type > EVC_UNSPEC_NUT62) {
ret = AVERROR_INVALIDDATA;
goto end;
}
// @see ISO/IEC 14496-15:2021 Coding of audio-visual objects - Part 15: section 12.3.3.3
// NAL_unit_type indicates the type of the NAL units in the following array (which shall be all of that type);

View File

@ -1,3 +1,3 @@
55294f868fa3b31d34a48344c4f72630 *tests/data/lavf-fate/lavf.evc.mp4
885fb330b20632b88ef9d7fb03dfa2e9 *tests/data/lavf-fate/lavf.evc.mp4
37386 tests/data/lavf-fate/lavf.evc.mp4
tests/data/lavf-fate/lavf.evc.mp4 CRC=0x48063f85