diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2012-02-29 13:55:09 -0800 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2012-02-29 14:04:23 -0800 |
commit | 8a9faf33f2b4f40afbc3393b2be49867cea0c92d (patch) | |
tree | c455bbdf156ad7011c3f89a4a78ced12def993b7 /libavcodec/cscd.c | |
parent | d1604b3de96575195b219028e2c4f08b2259aa7d (diff) | |
download | ffmpeg-8a9faf33f2b4f40afbc3393b2be49867cea0c92d.tar.gz |
cscd: use negative error values to indicate decode_init() failures.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Diffstat (limited to 'libavcodec/cscd.c')
-rw-r--r-- | libavcodec/cscd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/cscd.c b/libavcodec/cscd.c index 43f0e5e7d5..17f487842d 100644 --- a/libavcodec/cscd.c +++ b/libavcodec/cscd.c @@ -228,7 +228,7 @@ static av_cold int decode_init(AVCodecContext *avctx) { av_log(avctx, AV_LOG_ERROR, "CamStudio codec error: invalid depth %i bpp\n", avctx->bits_per_coded_sample); - return 1; + return AVERROR_INVALIDDATA; } c->bpp = avctx->bits_per_coded_sample; c->pic.data[0] = NULL; @@ -241,7 +241,7 @@ static av_cold int decode_init(AVCodecContext *avctx) { c->decomp_buf = av_malloc(c->decomp_size + AV_LZO_OUTPUT_PADDING); if (!c->decomp_buf) { av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n"); - return 1; + return AVERROR(ENOMEM); } return 0; } |