Commit 3b81bba3 authored by Xi Wang's avatar Xi Wang Committed by Derek Buitenhuis

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: 's avatarXi Wang <xi.wang@gmail.com>
Signed-off-by: 's avatarDerek Buitenhuis <derek.buitenhuis@gmail.com>
parent 3f89b49b
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment