[FFmpeg-devel,1/2] avcodec/vorbisenc: use av_assert1() instead of assert()

Submitted by Michael Niedermayer on Feb. 1, 2019, 10:33 p.m.

Details

Message ID 20190201223335.720-1-michael@niedermayer.cc
State New
Headers show

Commit Message

Michael Niedermayer Feb. 1, 2019, 10:33 p.m.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/vorbisenc.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

Patch hide | download patch | download mbox

diff --git a/libavcodec/vorbisenc.c b/libavcodec/vorbisenc.c
index 18a679f2dc..54cac0c0ad 100644
--- a/libavcodec/vorbisenc.c
+++ b/libavcodec/vorbisenc.c
@@ -40,9 +40,6 @@ 
 #define BITSTREAM_WRITER_LE
 #include "put_bits.h"
 
-#undef NDEBUG
-#include <assert.h>
-
 typedef struct vorbis_enc_codebook {
     int nentries;
     uint8_t *lens;
@@ -223,8 +220,8 @@  static int ready_residue(vorbis_enc_residue *rc, vorbis_enc_context *venc)
         if (j == 8) // zero
             continue;
         cb = &venc->codebooks[rc->books[i][j]];
-        assert(cb->ndimensions >= 2);
-        assert(cb->lookup);
+        av_assert1(cb->ndimensions >= 2);
+        av_assert1(cb->lookup);
 
         for (j = 0; j < cb->nentries; j++) {
             float a;
@@ -853,7 +850,7 @@  static int floor_encode(vorbis_enc_context *venc, vorbis_enc_floor *fc,
                     if (coded[counter + k] < maxval)
                         break;
                 }
-                assert(l != csub);
+                av_assert1(l != csub);
                 cval   |= l << cshift;
                 cshift += c->subclass;
             }
@@ -884,7 +881,7 @@  static float *put_vector(vorbis_enc_codebook *book, PutBitContext *pb,
 {
     int i, entry = -1;
     float distance = FLT_MAX;
-    assert(book->dimensions);
+    av_assert1(book->dimensions);
     for (i = 0; i < book->nentries; i++) {
         float * vec = book->dimensions + i * book->ndimensions, d = book->pow2[i];
         int j;
@@ -951,8 +948,8 @@  static int residue_encode(vorbis_enc_context *venc, vorbis_enc_residue *rc,
                     if (nbook == -1)
                         continue;
 
-                    assert(rc->type == 0 || rc->type == 2);
-                    assert(!(psize % book->ndimensions));
+                    av_assert1(rc->type == 0 || rc->type == 2);
+                    av_assert1(!(psize % book->ndimensions));
 
                     if (rc->type == 0) {
                         for (k = 0; k < psize; k += book->ndimensions) {