diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-06-01 01:52:01 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-06-01 01:57:29 +0200 |
commit | 73e150fff735d99193b2ebef902625d6ee4c8209 (patch) | |
tree | 9f19f64611876de567d506bf17cdcf2e285df8cc /libavcodec/huffyuvenc.c | |
parent | 10531d48a0f91aea57eac7e1c6cf5857e601826e (diff) | |
parent | 7d2a6826912b629f17f3b0c5268e334fa123c4c9 (diff) | |
download | ffmpeg-73e150fff735d99193b2ebef902625d6ee4c8209.tar.gz |
Merge commit '7d2a6826912b629f17f3b0c5268e334fa123c4c9'
* commit '7d2a6826912b629f17f3b0c5268e334fa123c4c9':
huffyuv: Check memory allocation
See: 4a722a5cab15d5aefbf4dd83baa8be5a046580ca
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/huffyuvenc.c')
-rw-r--r-- | libavcodec/huffyuvenc.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index f0179dfa5b..22e2cb86e3 100644 --- a/libavcodec/huffyuvenc.c +++ b/libavcodec/huffyuvenc.c @@ -220,8 +220,6 @@ static av_cold int encode_init(AVCodecContext *avctx) ff_huffyuvencdsp_init(&s->hencdsp); avctx->extradata = av_mallocz(3*MAX_N + 4); - if (!avctx->extradata) - return AVERROR(ENOMEM); if (s->flags&CODEC_FLAG_PASS1) { #define STATS_OUT_SIZE 21*MAX_N*3 + 4 avctx->stats_out = av_mallocz(STATS_OUT_SIZE); // 21*256*3(%llu ) + 3(\n) + 1(0) = 16132 @@ -231,7 +229,7 @@ static av_cold int encode_init(AVCodecContext *avctx) s->version = 2; avctx->coded_frame = av_frame_alloc(); - if (!avctx->coded_frame) + if (!avctx->extradata || !avctx->coded_frame) return AVERROR(ENOMEM); avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I; |