mxfdec: return error if no segments are available in mxf_get_sorted_table_segments

Fixes CID732275.
This commit is contained in:
Janne Grunau 2012-10-09 21:45:23 +02:00
parent 35a35d49d2
commit bd141f5ec9

View File

@ -950,6 +950,9 @@ static int mxf_get_sorted_table_segments(MXFContext *mxf, int *nb_sorted_segment
if (mxf->metadata_sets[i]->type == IndexTableSegment)
nb_segments++;
if (!nb_segments)
return AVERROR_INVALIDDATA;
*sorted_segments = av_mallocz(nb_segments * sizeof(**sorted_segments));
unsorted_segments = av_mallocz(nb_segments * sizeof(*unsorted_segments));
if (!sorted_segments || !unsorted_segments) {