[FFmpeg-cvslog] mxfdec: return error if no segments are available in mxf_get_sorted_table_segments
Janne Grunau
git at videolan.org
Thu Oct 11 15:50:56 CEST 2012
ffmpeg | branch: master | Janne Grunau <janne-libav at jannau.net> | Tue Oct 9 21:45:23 2012 +0200| [bd141f5ec97f394d1043a2f9778d74ba1008db26] | committer: Janne Grunau
mxfdec: return error if no segments are available in mxf_get_sorted_table_segments
Fixes CID732275.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bd141f5ec97f394d1043a2f9778d74ba1008db26
---
libavformat/mxfdec.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 9a61d02..25d18f4 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) {
More information about the ffmpeg-cvslog
mailing list