entry = (GF_MPEGVisualSampleEntryBox*)gf_list_get(trak->Media->information->sampleTable->SampleDescription->child_boxes, DescriptionIndex-1);
if (!entry) return NULL;
-
+ if (entry->internal_type != GF_ISOM_SAMPLE_ENTRY_VIDEO) return NULL;
if (!entry->avc_config) return NULL;
return AVC_DuplicateConfig(entry->avc_config->config);
}
return NULL;
entry = (GF_MPEGVisualSampleEntryBox*)gf_list_get(trak->Media->information->sampleTable->SampleDescription->child_boxes, DescriptionIndex-1);
if (!entry) return NULL;
+ if (entry->internal_type != GF_ISOM_SAMPLE_ENTRY_VIDEO) return NULL;
if (!entry->hevc_config) return NULL;
return HEVC_DuplicateConfig(entry->hevc_config->config);
}
return NULL;
entry = (GF_MPEGVisualSampleEntryBox*)gf_list_get(trak->Media->information->sampleTable->SampleDescription->child_boxes, DescriptionIndex-1);
if (!entry) return NULL;
+ if (entry->internal_type != GF_ISOM_SAMPLE_ENTRY_VIDEO) return NULL;
if (!entry->svc_config) return NULL;
return AVC_DuplicateConfig(entry->svc_config->config);
}
return NULL;
entry = (GF_MPEGVisualSampleEntryBox*)gf_list_get(trak->Media->information->sampleTable->SampleDescription->child_boxes, DescriptionIndex-1);
if (!entry) return NULL;
+ if (entry->internal_type != GF_ISOM_SAMPLE_ENTRY_VIDEO) return NULL;
if (!entry->mvc_config) return NULL;
return AVC_DuplicateConfig(entry->mvc_config->config);
}
trak = gf_isom_get_track_from_file(the_file, trackNumber);
if (!trak || !trak->Media || !DescriptionIndex) return NULL;
entry = (GF_MPEGVisualSampleEntryBox*)gf_list_get(trak->Media->information->sampleTable->SampleDescription->child_boxes, DescriptionIndex - 1);
- if (!entry || !entry->av1_config|| !entry->av1_config->config) return NULL;
+ if (!entry) return NULL;
+ if (entry->internal_type != GF_ISOM_SAMPLE_ENTRY_VIDEO) return NULL;
+ if (!entry->av1_config|| !entry->av1_config->config) return NULL;
return AV1_DuplicateConfig(entry->av1_config->config);
}
trak = gf_isom_get_track_from_file(the_file, trackNumber);
if (!trak || !trak->Media || !DescriptionIndex) return NULL;
entry = (GF_MPEGVisualSampleEntryBox*)gf_list_get(trak->Media->information->sampleTable->SampleDescription->child_boxes, DescriptionIndex - 1);
- if (!entry || !entry->vp_config) return NULL;
+ if (!entry) return NULL;
+ if (entry->internal_type != GF_ISOM_SAMPLE_ENTRY_VIDEO) return NULL;
+ if (!entry->vp_config || !entry->vp_config->config) return NULL;
return VP_DuplicateConfig(entry->vp_config->config);
}
trak = gf_isom_get_track_from_file(the_file, trackNumber);
if (!trak || !trak->Media || !DescriptionIndex) return NULL;
entry = (GF_MPEGVisualSampleEntryBox*)gf_list_get(trak->Media->information->sampleTable->SampleDescription->child_boxes, DescriptionIndex - 1);
- if (!entry || !entry->dovi_config) return NULL;
+ if (!entry) return NULL;
+ if (entry->internal_type != GF_ISOM_SAMPLE_ENTRY_VIDEO) return NULL;
+ if (!entry->dovi_config) return NULL;
return DOVI_DuplicateConfig(&entry->dovi_config->DOVIConfig);
}
entry = (GF_MPEGVisualSampleEntryBox*)gf_list_get(trak->Media->information->sampleTable->SampleDescription->child_boxes, DescriptionIndex-1);
if (!entry) return GF_ISOM_AVCTYPE_NONE;
+ if (entry->internal_type != GF_ISOM_SAMPLE_ENTRY_VIDEO) return GF_ISOM_AVCTYPE_NONE;
type = entry->type;
return GF_ISOM_HEVCTYPE_NONE;
entry = (GF_MPEGVisualSampleEntryBox*)gf_list_get(trak->Media->information->sampleTable->SampleDescription->child_boxes, DescriptionIndex-1);
if (!entry) return GF_ISOM_HEVCTYPE_NONE;
+ if (entry->internal_type != GF_ISOM_SAMPLE_ENTRY_VIDEO) return GF_ISOM_HEVCTYPE_NONE;
type = entry->type;
if (type == GF_ISOM_BOX_TYPE_ENCV) {
return NULL;
entry = (GF_MPEGVisualSampleEntryBox*)gf_list_get(trak->Media->information->sampleTable->SampleDescription->child_boxes, DescriptionIndex-1);
if (!entry) return NULL;
+ if (entry->internal_type != GF_ISOM_SAMPLE_ENTRY_VIDEO) return NULL;
if (!entry->lhvc_config) return NULL;
lhvc = HEVC_DuplicateConfig(entry->lhvc_config->config);
if (!lhvc) return NULL;
case GF_ISOM_SUBTYPE_3GP_EVRC:
case GF_ISOM_SUBTYPE_3GP_QCELP:
case GF_ISOM_SUBTYPE_3GP_SMV:
+ if (entry->internal_type != GF_ISOM_SAMPLE_ENTRY_AUDIO) return NULL;
if (! ((GF_MPEGAudioSampleEntryBox*)entry)->cfg_3gpp) return NULL;
config = & ((GF_MPEGAudioSampleEntryBox*)entry)->cfg_3gpp->cfg;
break;
case GF_ISOM_SUBTYPE_3GP_H263:
+ if (entry->internal_type != GF_ISOM_SAMPLE_ENTRY_VIDEO) return NULL;
if (! ((GF_MPEGVisualSampleEntryBox*)entry)->cfg_3gpp) return NULL;
config = & ((GF_MPEGVisualSampleEntryBox*)entry)->cfg_3gpp->cfg;
break;
if (!trak || !StreamDescriptionIndex) return NULL;
entry = (GF_MPEGAudioSampleEntryBox *)gf_list_get(trak->Media->information->sampleTable->SampleDescription->child_boxes, StreamDescriptionIndex-1);
- if (!entry || !entry->cfg_ac3) return NULL;
+ if (!entry) return NULL;
if (!entry->cfg_ac3) return NULL;
+ if (entry->internal_type != GF_ISOM_SAMPLE_ENTRY_AUDIO) return NULL;
if ( (entry->cfg_ac3->type!=GF_ISOM_BOX_TYPE_DAC3) && (entry->cfg_ac3->type!=GF_ISOM_BOX_TYPE_DEC3) ) return NULL;
res = (GF_AC3Config*)gf_malloc(sizeof(GF_AC3Config));
if (!trak || !StreamDescriptionIndex) return GF_BAD_PARAM;
entry = (GF_MPEGAudioSampleEntryBox *)gf_list_get(trak->Media->information->sampleTable->SampleDescription->child_boxes, StreamDescriptionIndex-1);
+ if (!entry) return GF_BAD_PARAM;
+ if (entry->internal_type != GF_ISOM_SAMPLE_ENTRY_AUDIO) return GF_BAD_PARAM;
type = entry->type;
if (type==GF_ISOM_BOX_TYPE_ENCA) {
if (!trak || !StreamDescriptionIndex) return GF_BAD_PARAM;
entry = (GF_MPEGAudioSampleEntryBox *)gf_list_get(trak->Media->information->sampleTable->SampleDescription->child_boxes, StreamDescriptionIndex-1);
+ if (!entry) return GF_BAD_PARAM;
+ if (entry->internal_type != GF_ISOM_SAMPLE_ENTRY_AUDIO) return GF_BAD_PARAM;
type = entry->type;
if (type==GF_ISOM_BOX_TYPE_ENCA) {
case GF_ISOM_SUBTYPE_3GP_EVRC:
case GF_ISOM_SUBTYPE_3GP_QCELP:
case GF_ISOM_SUBTYPE_3GP_SMV:
+ if (a_entry->internal_type != GF_ISOM_SAMPLE_ENTRY_AUDIO) return GF_ISOM_INVALID_FILE;
cfg = &a_entry->cfg_3gpp->cfg;
break;
case GF_ISOM_SUBTYPE_3GP_H263:
+ if (v_entry->internal_type != GF_ISOM_SAMPLE_ENTRY_VIDEO) return GF_ISOM_INVALID_FILE;
cfg = & v_entry->cfg_3gpp->cfg;
break;
default: