diff options
author | Martin Storsjö <martin@martin.st> | 2012-07-02 10:39:25 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2012-07-03 12:16:39 +0300 |
commit | 4d8516fdb15d0177ad745228508254dee187dff9 (patch) | |
tree | 12899acb87656cc4dc7158b003c0c979e8bca43a /libavcodec/snowenc.c | |
parent | 4719ea7e1e6113010da2ccdb9a84e45104ab4de7 (diff) | |
download | ffmpeg-4d8516fdb15d0177ad745228508254dee187dff9.tar.gz |
snow: Check mallocs at init
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/snowenc.c')
-rw-r--r-- | libavcodec/snowenc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c index 627a406af9..f8694ae813 100644 --- a/libavcodec/snowenc.c +++ b/libavcodec/snowenc.c @@ -155,7 +155,7 @@ static void dwt_quantize(SnowContext *s, Plane *p, DWTELEM *buffer, int width, i static av_cold int encode_init(AVCodecContext *avctx) { SnowContext *s = avctx->priv_data; - int plane_index; + int plane_index, ret; if(avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL){ av_log(avctx, AV_LOG_ERROR, "This codec is under development, files encoded with it may not be decodable with future versions!!!\n" @@ -184,7 +184,10 @@ static av_cold int encode_init(AVCodecContext *avctx) s->plane[plane_index].fast_mc= 1; } - ff_snow_common_init(avctx); + if ((ret = ff_snow_common_init(avctx)) < 0) { + ff_snow_common_end(avctx->priv_data); + return ret; + } ff_snow_alloc_blocks(s); s->version=0; |