[FFmpeg-cvslog] aacenc: replace scale factor warning by assert

Michael Niedermayer git at videolan.org
Fri Oct 26 03:39:05 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Oct 26 02:11:20 2012 +0200| [f69f9b387624bb5e3749e74c180bd092e0dcd20c] | committer: Michael Niedermayer

aacenc: replace scale factor warning by assert

The code would crash after printing the warning

Fixes CID717903, CID717904
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f69f9b387624bb5e3749e74c180bd092e0dcd20c
---

 libavcodec/aacenc.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index 9178bab..0a5aacf 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -385,8 +385,7 @@ static void encode_scale_factors(AVCodecContext *avctx, AACEncContext *s,
         for (i = 0; i < sce->ics.max_sfb; i++) {
             if (!sce->zeroes[w*16 + i]) {
                 diff = sce->sf_idx[w*16 + i] - off + SCALE_DIFF_ZERO;
-                if (diff < 0 || diff > 120)
-                    av_log(avctx, AV_LOG_ERROR, "Scalefactor difference is too big to be coded\n");
+                av_assert0(diff >= 0 && diff <= 120);
                 off = sce->sf_idx[w*16 + i];
                 put_bits(&s->pb, ff_aac_scalefactor_bits[diff], ff_aac_scalefactor_code[diff]);
             }



More information about the ffmpeg-cvslog mailing list