[FFmpeg-cvslog] mxfdec: fix NULL checking in mxf_get_sorted_table_segments()

Xi Wang git at videolan.org
Sat Jan 5 13:57:00 CET 2013


ffmpeg | branch: master | Xi Wang <xi.wang at gmail.com> | Fri Jan  4 21:09:47 2013 +0000| [3b81bba3bc5aca98d891cb377d27566de4745225] | committer: 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: Xi Wang <xi.wang at gmail.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3b81bba3bc5aca98d891cb377d27566de4745225
---

 libavformat/mxfdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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



More information about the ffmpeg-cvslog mailing list