[FFmpeg-cvslog] libschroedingerdec: check malloc

Jordi Ortiz git at videolan.org
Sat Apr 28 21:10:21 CEST 2012


ffmpeg | branch: master | Jordi Ortiz <nenjordi at gmail.com> | Thu Apr 26 21:14:07 2012 +0200| [a7fa5ce671d31d77ecb8b8d302f8df8e6e0768f6] | committer: Diego Biurrun

libschroedingerdec: check malloc

Signed-off-by: Diego Biurrun <diego at biurrun.de>

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

 libavcodec/libschroedingerdec.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libavcodec/libschroedingerdec.c b/libavcodec/libschroedingerdec.c
index f573d8a..68d9a25 100644
--- a/libavcodec/libschroedingerdec.c
+++ b/libavcodec/libschroedingerdec.c
@@ -106,6 +106,11 @@ static SchroBuffer *FindNextSchroParseUnit(SchroParseUnitContext *parse_ctx)
         return NULL;
 
     in_buf = av_malloc(next_pu_offset);
+    if (!in_buf) {
+        av_log(parse_ctx, AV_LOG_ERROR, "Unable to allocate input buffer\n");
+        return NULL;
+    }
+
     memcpy(in_buf, parse_ctx->buf, next_pu_offset);
     enc_buf       = schro_buffer_new_with_data(in_buf, next_pu_offset);
     enc_buf->free = libschroedinger_decode_buffer_free;



More information about the ffmpeg-cvslog mailing list