diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-02-23 13:42:16 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-02-23 13:42:16 +0300 |
commit | 96b495f443832082777d7dad7349dd6ec97b6cb9 (patch) | |
tree | 67c21ef1c8441d60dcc7054cae839b451d448a75 /libavcodec/libschroedingerenc.c | |
parent | 0425e16d96cccf6de32231ecfc37cde72985dde5 (diff) | |
parent | e570f895cdccf2535a71fec1c607751ddb94fd5a (diff) |
Merge commit 'e570f895cdccf2535a71fec1c607751ddb94fd5a'
* commit 'e570f895cdccf2535a71fec1c607751ddb94fd5a':
libschroedinger: Check memory allocations
Conflicts:
libavcodec/libschroedinger.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/libschroedingerenc.c')
-rw-r--r-- | libavcodec/libschroedingerenc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/libschroedingerenc.c b/libavcodec/libschroedingerenc.c index 294fb063c6..f7a32353e2 100644 --- a/libavcodec/libschroedingerenc.c +++ b/libavcodec/libschroedingerenc.c @@ -284,6 +284,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); } @@ -332,6 +334,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; |