[FFmpeg-devel] [PATCH] oggparsespeex: Fix unchecked malloc

Derek Buitenhuis derek.buitenhuis at gmail.com
Sun Nov 22 19:10:57 CET 2015


Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
---
 libavformat/oggparsespeex.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/oggparsespeex.c b/libavformat/oggparsespeex.c
index 9b5c65f..c86b127 100644
--- a/libavformat/oggparsespeex.c
+++ b/libavformat/oggparsespeex.c
@@ -47,6 +47,8 @@ static int speex_header(AVFormatContext *s, int idx) {
 
     if (!spxp) {
         spxp = av_mallocz(sizeof(*spxp));
+        if (!spxp)
+            return AVERROR(ENOMEM);
         os->private = spxp;
     }
 
-- 
2.6.2



More information about the ffmpeg-devel mailing list