From 82c252972b494402818aa07df5bdbac16111c09d Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sat, 28 Jan 2012 19:06:08 +0000 Subject: [PATCH] adpcmenc: check return value of avcodec_alloc_frame() Signed-off-by: Paul B Mahol Signed-off-by: Michael Niedermayer --- libavcodec/adpcmenc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c index e500a1cdbf..82cd8b5992 100644 --- a/libavcodec/adpcmenc.c +++ b/libavcodec/adpcmenc.c @@ -137,7 +137,8 @@ static av_cold int adpcm_encode_init(AVCodecContext *avctx) } avctx->coded_frame = avcodec_alloc_frame(); - avctx->coded_frame->key_frame= 1; + if (!avctx->coded_frame) + goto error; return 0; error: