X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fsvq1dec.c;h=a95c7c866e1048fb24282002be27895e7e29f520;hb=088dfd3ff15eba342863c74be53f7ca614957966;hp=2f9ea1663042b7867b8b79a84c3df7d411aa71e0;hpb=0c00e734ef2b1cac83cf71f331bdb0f6e504de23;p=ffmpeg diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c index 2f9ea166304..a95c7c866e1 100644 --- a/libavcodec/svq1dec.c +++ b/libavcodec/svq1dec.c @@ -40,9 +40,6 @@ #include "mathops.h" #include "svq1.h" -#undef NDEBUG -#include - static VLC svq1_block_type; static VLC svq1_motion_component; static VLC svq1_intra_multistage[6]; @@ -190,12 +187,13 @@ static int svq1_decode_block_intra(GetBitContext *bitbuf, uint8_t *pixels, continue; /* skip vector */ } - if (stages > 0 && level >= 4) { + if ((stages > 0 && level >= 4)) { av_dlog(NULL, "Error (svq1_decode_block_intra): invalid vector: stages=%i level=%i\n", stages, level); return AVERROR_INVALIDDATA; /* invalid vector */ } + av_assert0(stages >= 0); mean = get_vlc2(bitbuf, svq1_intra_mean.table, 8, 3); @@ -252,12 +250,13 @@ static int svq1_decode_block_non_intra(GetBitContext *bitbuf, uint8_t *pixels, if (stages == -1) continue; /* skip vector */ - if ((stages > 0) && (level >= 4)) { + if ((stages > 0 && level >= 4)) { av_dlog(NULL, "Error (svq1_decode_block_non_intra): invalid vector: stages=%i level=%i\n", stages, level); return AVERROR_INVALIDDATA; /* invalid vector */ } + av_assert0(stages >= 0); mean = get_vlc2(bitbuf, svq1_inter_mean.table, 9, 3) - 256;