diff options
author | Xi Wang <xi.wang@gmail.com> | 2013-01-04 21:09:47 +0000 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2013-01-04 20:43:42 -0500 |
commit | 3b81bba3bc5aca98d891cb377d27566de4745225 (patch) | |
tree | 1cea6692f20b526d3db892f58e46a6497f9f5a99 /libavformat/mxfdec.c | |
parent | 3f89b49b07380e94a5685819fc7014b36d8ad1f2 (diff) | |
download | ffmpeg-3b81bba3bc5aca98d891cb377d27566de4745225.tar.gz |
mxfdec: fix NULL checking in mxf_get_sorted_table_segments()
The following out-of-memory check is broken.
*sorted_segments = av_mallocz(...);
if (!sorted_segments) { ... }
The correct NULL check should use *sorted_segments.
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavformat/mxfdec.c')
-rw-r--r-- | libavformat/mxfdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 61b9c687e1..18f7b26fa1 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -955,7 +955,7 @@ static int mxf_get_sorted_table_segments(MXFContext *mxf, int *nb_sorted_segment *sorted_segments = av_mallocz(nb_segments * sizeof(**sorted_segments)); unsorted_segments = av_mallocz(nb_segments * sizeof(*unsorted_segments)); - if (!sorted_segments || !unsorted_segments) { + if (!*sorted_segments || !unsorted_segments) { av_freep(sorted_segments); av_free(unsorted_segments); return AVERROR(ENOMEM); |