[FFmpeg-cvslog] adxenc: log an error message and return AVERROR(EINVAL) for invalid channels
Justin Ruggles
git at videolan.org
Thu Jan 5 02:18:49 CET 2012
ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Mon Dec 19 09:45:17 2011 -0500| [cc40c056d01a95b0a57950d4d8aec9e86060c6b6] | committer: Justin Ruggles
adxenc: log an error message and return AVERROR(EINVAL) for invalid channels
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cc40c056d01a95b0a57950d4d8aec9e86060c6b6
---
libavcodec/adxenc.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/libavcodec/adxenc.c b/libavcodec/adxenc.c
index cff5bb8..a580bb3 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();
More information about the ffmpeg-cvslog
mailing list