diff options
author | Janne Grunau <janne-libav@jannau.net> | 2012-10-09 23:45:23 +0400 |
---|---|---|
committer | Janne Grunau <janne-libav@jannau.net> | 2012-10-10 23:24:32 +0400 |
commit | bd141f5ec97f394d1043a2f9778d74ba1008db26 (patch) | |
tree | cbeb131371e249abdeec2b97d6429544b9467f94 /libavformat | |
parent | 35a35d49d23c2b799e771f8947c0bc6cc6a45fe8 (diff) |
mxfdec: return error if no segments are available in mxf_get_sorted_table_segments
Fixes CID732275.
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mxfdec.c | 3 |
1 files changed, 3 insertions, 0 deletions
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) { |