summaryrefslogtreecommitdiff
path: root/libavcodec/libschroedingerenc.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2015-02-22 19:49:06 +0000
committerVittorio Giovara <vittorio.giovara@gmail.com>2015-02-22 22:32:18 +0000
commite570f895cdccf2535a71fec1c607751ddb94fd5a (patch)
tree10a4afdb594f48323232eaba438da8aaba4ee3d6 /libavcodec/libschroedingerenc.c
parent521979e6b1e7a89751aebc285a40d6508f8af48f (diff)
libschroedinger: Check memory allocations
Diffstat (limited to 'libavcodec/libschroedingerenc.c')
-rw-r--r--libavcodec/libschroedingerenc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/libschroedingerenc.c b/libavcodec/libschroedingerenc.c
index 3dc1481893..b2c492b990 100644
--- a/libavcodec/libschroedingerenc.c
+++ b/libavcodec/libschroedingerenc.c
@@ -283,6 +283,8 @@ static int libschroedinger_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
} else {
/* Allocate frame data to schro input buffer. */
SchroFrame *in_frame = libschroedinger_frame_from_data(avctx, frame);
+ if (!in_frame)
+ return AVERROR(ENOMEM);
/* Load next frame. */
schro_encoder_push_frame(encoder, in_frame);
}
@@ -331,6 +333,8 @@ static int libschroedinger_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
/* Create output frame. */
p_frame_output = av_mallocz(sizeof(FFSchroEncodedFrame));
+ if (!p_frame_output)
+ return AVERROR(ENOMEM);
/* Set output data. */
p_frame_output->size = p_schro_params->enc_buf_size;
p_frame_output->p_encbuf = p_schro_params->enc_buf;