From bd141f5ec97f394d1043a2f9778d74ba1008db26 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Tue, 9 Oct 2012 21:45:23 +0200 Subject: [PATCH] mxfdec: return error if no segments are available in mxf_get_sorted_table_segments Fixes CID732275. --- libavformat/mxfdec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 9a61d0243e..25d18f4829 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -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) {