From patchwork Fri Feb 1 22:33:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 11949 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 94A92445B22 for ; Sat, 2 Feb 2019 00:34:47 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7232668A6F6; Sat, 2 Feb 2019 00:34:47 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe05-2.mx.upcmail.net (vie01a-dmta-pe05-2.mx.upcmail.net [84.116.36.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6D7F368A6BE for ; Sat, 2 Feb 2019 00:34:40 +0200 (EET) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe05.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1gphOS-0003Hd-0T for ffmpeg-devel@ffmpeg.org; Fri, 01 Feb 2019 23:34:40 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id phNUgAjxa2WSsphNUg0sGZ; Fri, 01 Feb 2019 23:33:40 +0100 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.41.20 X-CNFS-Analysis: v=2.3 cv=E7kcWpVl c=1 sm=1 tr=0 a=I1eytVlZLDX1BM2VTtTtSw==:117 a=I1eytVlZLDX1BM2VTtTtSw==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=gaX0DR2eFRrWF4WpffkA:9 a=pHzHmUro8NiASowvMSCR:22 a=Ew2E2A-JSTLzCXPT_086:22 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 1 Feb 2019 23:33:34 +0100 Message-Id: <20190201223335.720-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CMAE-Envelope: MS4wfE8X2qD9a7t8LlPANl340lR+DZl1wvP4sz+pIskgFYqdWkSTe7vd9JOdUXX0N2lvYbj/YjaEO9+QGLRJJ/HBkWZe/O8Tzdo7qWhunOQq9u2XZiOyokpH qzSsThCZZrX5Mit4TTHbOYefWa4ByC4xWHGZ71WgQzF0gXtuSIIktaKK Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/vorbisenc: use av_assert1() instead of assert() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Michael Niedermayer --- libavcodec/vorbisenc.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) 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 - 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) {