Module: libav
Branch: master
Commit: 3b81bba3bc5aca98d891cb377d27566de4745225

Author:    Xi Wang <xi.w...@gmail.com>
Committer: Derek Buitenhuis <derek.buitenh...@gmail.com>
Date:      Fri Jan  4 21:09:47 2013 +0000

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.w...@gmail.com>
Signed-off-by: Derek Buitenhuis <derek.buitenh...@gmail.com>

---

 libavformat/mxfdec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 61b9c68..18f7b26 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);

_______________________________________________
libav-commits mailing list
libav-commits@libav.org
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to