[FFmpeg-devel] [PATCH] libfdk-aacenc: Actually check for upper bounds of cutoff

Derek Buitenhuis derek.buitenhuis at gmail.com
Sat Feb 9 20:43:12 CET 2013


Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
---
I am assuming it is possible for avctx->cutoff to be >20000. If you
do 'avconv -cutoff 20000', no warnings about clipping appear, so either
it clips silently (evil) or this patch is needed.
---
 libavcodec/libfdk-aacenc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c
index 06576aa..d76b215 100644
--- a/libavcodec/libfdk-aacenc.c
+++ b/libavcodec/libfdk-aacenc.c
@@ -250,7 +250,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
     }
 
     if (avctx->cutoff > 0) {
-        if (avctx->cutoff < (avctx->sample_rate + 255) >> 8) {
+        if (avctx->cutoff < (avctx->sample_rate + 255) >> 8 || avctx->cutoff > 20000) {
             av_log(avctx, AV_LOG_ERROR, "cutoff valid range is %d-20000\n",
                    (avctx->sample_rate + 255) >> 8);
             goto error;
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list