[FFmpeg-cvslog] soxdec: check av_malloc return.

Michael Niedermayer git at videolan.org
Tue Dec 20 00:15:27 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Dec 19 19:11:49 2011 +0100| [1dcce49e10dcebde9d2cc52565fa299c5fdfd691] | committer: Michael Niedermayer

soxdec: check av_malloc return.
Bug found by: durandal_1707

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavformat/soxdec.c b/libavformat/soxdec.c
index ad8f488..23fea38 100644
--- a/libavformat/soxdec.c
+++ b/libavformat/soxdec.c
@@ -98,6 +98,8 @@ static int sox_read_header(AVFormatContext *s,
 
     if (comment_size && comment_size < UINT_MAX) {
         char *comment = av_malloc(comment_size+1);
+        if(!comment)
+            return AVERROR(ENOMEM);
         if (avio_read(pb, comment, comment_size) != comment_size) {
             av_freep(&comment);
             return AVERROR(EIO);



More information about the ffmpeg-cvslog mailing list