diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-02-02 02:02:18 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-02-02 02:24:09 +0100 |
commit | 4c677df27cc62e5dd8df9da9d0ca9fb7d963bc08 (patch) | |
tree | 1453699ac3b21c5c25889aaed590ca4bc0c7a755 /libavcodec/zmbvenc.c | |
parent | 5cd8afee99c83b62e1474f122d947de7e4ad9ff5 (diff) | |
parent | 5ff88020ac4cd285fa00d0c559aa196bbd8526d7 (diff) | |
download | ffmpeg-4c677df27cc62e5dd8df9da9d0ca9fb7d963bc08.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master: (22 commits)
frwu: Employ more meaningful return values.
fraps: Use av_fast_padded_malloc() instead of av_realloc()
mjpegdec: use av_fast_padded_malloc()
eatqi: use av_fast_padded_malloc()
asv1: use av_fast_padded_malloc()
avcodec: Add av_fast_padded_malloc().
swscale: enable dithering in MMX functions.
swscale: make rgb24 function macros slightly smaller.
avcodec.h: Remove some disabled cruft.
swscale: remove obsolete comment.
swscale-test: Drop unused argc and argv arguments from main().
zmbv: Employ more meaningful return values.
zmbvenc: Employ more meaningful return values.
vc1: prevent null pointer dereference on broken files
zmbv: check av_realloc() return values and avoid memleaks on ENOMEM
truespeech: align buffer
ac3: Do not read past the end of ff_ac3_band_start_tab.
dv: Fix small stack overread related to CVE-2011-3929 and CVE-2011-3936.
dv: Fix null pointer dereference due to ach=0
dv: check stype
...
Conflicts:
doc/APIchanges
libavcodec/asv1.c
libavcodec/avcodec.h
libavcodec/eatqi.c
libavcodec/fraps.c
libavcodec/frwu.c
libavcodec/zmbv.c
libavformat/dv.c
libswscale/swscale.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/zmbvenc.c')
-rw-r--r-- | libavcodec/zmbvenc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/zmbvenc.c b/libavcodec/zmbvenc.c index 4b51fb167d..3211e6ff4d 100644 --- a/libavcodec/zmbvenc.c +++ b/libavcodec/zmbvenc.c @@ -265,7 +265,7 @@ static av_cold int encode_init(AVCodecContext *avctx) lvl = avctx->compression_level; if(lvl < 0 || lvl > 9){ av_log(avctx, AV_LOG_ERROR, "Compression level should be 0-9, not %i\n", lvl); - return -1; + return AVERROR(EINVAL); } // Needed if zlib unused or init aborted before deflateInit @@ -274,7 +274,7 @@ static av_cold int encode_init(AVCodecContext *avctx) ((avctx->width + ZMBV_BLOCK - 1) / ZMBV_BLOCK) * ((avctx->height + ZMBV_BLOCK - 1) / ZMBV_BLOCK) * 2 + 4; if ((c->work_buf = av_malloc(c->comp_size)) == NULL) { av_log(avctx, AV_LOG_ERROR, "Can't allocate work buffer.\n"); - return -1; + return AVERROR(ENOMEM); } /* Conservative upper bound taken from zlib v1.2.1 source via lcl.c */ c->comp_size = c->comp_size + ((c->comp_size + 7) >> 3) + @@ -283,12 +283,12 @@ static av_cold int encode_init(AVCodecContext *avctx) /* Allocate compression buffer */ if ((c->comp_buf = av_malloc(c->comp_size)) == NULL) { av_log(avctx, AV_LOG_ERROR, "Can't allocate compression buffer.\n"); - return -1; + return AVERROR(ENOMEM); } c->pstride = FFALIGN(avctx->width, 16); if ((c->prev = av_malloc(c->pstride * avctx->height)) == NULL) { av_log(avctx, AV_LOG_ERROR, "Can't allocate picture.\n"); - return -1; + return AVERROR(ENOMEM); } c->zstream.zalloc = Z_NULL; |