diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-12-19 09:45:17 -0500 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-01-03 18:47:41 -0500 |
commit | cc40c056d01a95b0a57950d4d8aec9e86060c6b6 (patch) | |
tree | 8a95e7b1645ed9a587b7ea39f8c064d0ac9261aa /libavcodec/adxenc.c | |
parent | a85ab8ad45bf2dc31c275bd04b2a740631ad6111 (diff) | |
download | ffmpeg-cc40c056d01a95b0a57950d4d8aec9e86060c6b6.tar.gz |
adxenc: log an error message and return AVERROR(EINVAL) for invalid channels
Diffstat (limited to 'libavcodec/adxenc.c')
-rw-r--r-- | libavcodec/adxenc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/adxenc.c b/libavcodec/adxenc.c index cff5bb8dd7..a580bb3bc0 100644 --- a/libavcodec/adxenc.c +++ b/libavcodec/adxenc.c @@ -101,8 +101,10 @@ static av_cold int adx_encode_init(AVCodecContext *avctx) { ADXContext *c = avctx->priv_data; - if (avctx->channels > 2) - return -1; + if (avctx->channels > 2) { + av_log(avctx, AV_LOG_ERROR, "Invalid number of channels\n"); + return AVERROR(EINVAL); + } avctx->frame_size = 32; avctx->coded_frame = avcodec_alloc_frame(); |