Unified · Split
| @@ -217,6 +217,10 @@ int ff_iamf_add_audio_element(IAMFContext *iamf, const AVStreamGroup *stg, void · 216 unmodified lines | |||
| 217 | 217 | ||
| 218 | if (stg->type != AV_STREAM_GROUP_PARAMS_IAMF_AUDIO_ELEMENT) | 218 | if (stg->type != AV_STREAM_GROUP_PARAMS_IAMF_AUDIO_ELEMENT) |
| 219 | return AVERROR(EINVAL); | 219 | 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 | } | ||
| 220 | 224 | ||
| 221 | iamf_audio_element = stg->params.iamf_audio_element; | 225 | iamf_audio_element = stg->params.iamf_audio_element; |
| 222 | if (iamf_audio_element->audio_element_type == AV_IAMF_AUDIO_ELEMENT_TYPE_SCENE) { | 226 | 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 | |||
| 386 | 390 | ||
| 387 | if (stg->type != AV_STREAM_GROUP_PARAMS_IAMF_MIX_PRESENTATION) | 391 | if (stg->type != AV_STREAM_GROUP_PARAMS_IAMF_MIX_PRESENTATION) |
| 388 | return AVERROR(EINVAL); | 392 | 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 | } | ||
| 389 | 397 | ||
| 390 | for (int i = 0; i < iamf->nb_mix_presentations; i++) { | 398 | for (int i = 0; i < iamf->nb_mix_presentations; i++) { |
| 391 | if (stg->id == iamf->mix_presentations[i]->mix_presentation_id) { | 399 | if (stg->id == iamf->mix_presentations[i]->mix_presentation_id) { |