History

avformat/iamf_writer: ensure the stream groups are not empty

James Almer committed 1 year ago

Commit cedd9151 parent 59258fb1 file · +8 −0Browse files

Unified · Split

libavformat/iamf_writer.c+8−0
@@ -217,6 +217,10 @@ int ff_iamf_add_audio_element(IAMFContext *iamf, const AVStreamGroup *stg, void · 216 unmodified lines
217217
218218 if (stg->type != AV_STREAM_GROUP_PARAMS_IAMF_AUDIO_ELEMENT)
219219 return AVERROR(EINVAL);
220+ if (!stg->nb_streams) {
221+ av_log(log_ctx, AV_LOG_ERROR, "Audio Element id %"PRId64" has no streams\n", stg->id);
222+ return AVERROR(EINVAL);
223+ }
220224
221225 iamf_audio_element = stg->params.iamf_audio_element;
222226 if (iamf_audio_element->audio_element_type == AV_IAMF_AUDIO_ELEMENT_TYPE_SCENE) {
@@ -386,6 +390,10 @@ int ff_iamf_add_mix_presentation(IAMFContext *iamf, const AVStreamGroup *stg, vo · 163 unmodified lines
386390
387391 if (stg->type != AV_STREAM_GROUP_PARAMS_IAMF_MIX_PRESENTATION)
388392 return AVERROR(EINVAL);
393+ if (!stg->nb_streams) {
394+ av_log(log_ctx, AV_LOG_ERROR, "Mix Presentation id %"PRId64" has no streams\n", stg->id);
395+ return AVERROR(EINVAL);
396+ }
389397
390398 for (int i = 0; i < iamf->nb_mix_presentations; i++) {
391399 if (stg->id == iamf->mix_presentations[i]->mix_presentation_id) {

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