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>
This commit is contained in:
Xi Wang 2013-01-04 21:09:47 +00:00 committed by Derek Buitenhuis
parent 3f89b49b07
commit 3b81bba3bc
1 changed files with 1 additions and 1 deletions

View File

@ -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);