case GF_ISOM_SUBTYPE_MPEG4_CRYP:
{
GF_DecoderConfig *dcd = gf_isom_get_decoder_config(file, i+1, 1);
+ if (!dcd) break;
switch (dcd->streamType) {
case GF_STREAM_VISUAL:
if (dcd->objectTypeIndication==GF_CODECID_MPEG4_PART2) nb_m4v++;
GF_SampleEntryBox *entry;
GF_Err e;
GF_SLConfig **slc;
+ GF_ESDBox *esds;
trak = gf_isom_get_track_from_file(the_file, trackNumber);
if (!trak) return GF_BAD_PARAM;
//we must be sure we are not using a remote ESD
switch (entry->type) {
case GF_ISOM_BOX_TYPE_MP4S:
- if (((GF_MPEGSampleEntryBox *)entry)->esd->desc->slConfig->predefined != SLPredef_MP4) return GF_BAD_PARAM;
+ esds = ((GF_MPEGSampleEntryBox *)entry)->esd;
+ if (!esds || !esds->desc || !esds->desc->slConfig || (esds->desc->slConfig->predefined != SLPredef_MP4))
+ return GF_ISOM_INVALID_FILE;
slc = & ((GF_MPEGSampleEntryBox *)entry)->slc;
break;
case GF_ISOM_BOX_TYPE_MP4A:
- if (((GF_MPEGAudioSampleEntryBox *)entry)->esd->desc->slConfig->predefined != SLPredef_MP4) return GF_BAD_PARAM;
+ esds = ((GF_MPEGAudioSampleEntryBox *)entry)->esd;
+ if (!esds || !esds->desc || !esds->desc->slConfig || (esds->desc->slConfig->predefined != SLPredef_MP4))
+ return GF_ISOM_INVALID_FILE;
slc = & ((GF_MPEGAudioSampleEntryBox *)entry)->slc;
break;
case GF_ISOM_BOX_TYPE_MP4V:
- if (((GF_MPEGVisualSampleEntryBox *)entry)->esd->desc->slConfig->predefined != SLPredef_MP4) return GF_BAD_PARAM;
+ esds = ((GF_MPEGVisualSampleEntryBox *)entry)->esd;
+ if (!esds || !esds->desc || !esds->desc->slConfig || (esds->desc->slConfig->predefined != SLPredef_MP4))
+ return GF_ISOM_INVALID_FILE;
slc = & ((GF_MPEGVisualSampleEntryBox *)entry)->slc;
break;
default:
if (hintType==GF_RTP_PAYT_MPEG4) {
tmp->rtp_p->slMap.CodecID = codecid;
/*set this SL for extraction.*/
- gf_isom_set_extraction_slc(file, TrackNum, 1, &my_sl);
+ *e = gf_isom_set_extraction_slc(file, TrackNum, 1, &my_sl);
+ if (*e) {
+ gf_hinter_track_del(tmp);
+ return NULL;
+ }
}
tmp->bandwidth = bandwidth;