summaryrefslogtreecommitdiff
path: root/libavcodec/libschroedingerdec.c
diff options
context:
space:
mode:
authorJordi Ortiz <nenjordi@gmail.com>2012-04-26 21:14:07 +0200
committerDiego Biurrun <diego@biurrun.de>2012-04-28 15:11:18 +0200
commita7fa5ce671d31d77ecb8b8d302f8df8e6e0768f6 (patch)
tree8afc1aa8da8e0a60bace187d40eff640e39155ff /libavcodec/libschroedingerdec.c
parent3b52e9da10158029edbd01bafe2235e653e6eaec (diff)
libschroedingerdec: check malloc
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavcodec/libschroedingerdec.c')
-rw-r--r--libavcodec/libschroedingerdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/libschroedingerdec.c b/libavcodec/libschroedingerdec.c
index f573d8a1e6..68d9a255ef 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;