X-Git-Url: https://git.piment-noir.org/?p=deb_ffmpeg.git;a=blobdiff_plain;f=ffmpeg%2Flibavcodec%2Fxface.c;h=8c0cbfdb84af3c42b9f5bda6660070cb6e874909;hp=0ebf2f2ec08d612baa4f0a067f19558c25694479;hb=092a91210f1b986dc846dc52988518f8f913eb72;hpb=dcebb6f35d810c9009a455808b016c790bb633b4 diff --git a/ffmpeg/libavcodec/xface.c b/ffmpeg/libavcodec/xface.c index 0ebf2f2..8c0cbfd 100644 --- a/ffmpeg/libavcodec/xface.c +++ b/ffmpeg/libavcodec/xface.c @@ -24,6 +24,8 @@ * X-Face common data and utilities definition. */ +#include "libavutil/avassert.h" + #include "xface.h" void ff_big_add(BigInt *b, uint8_t a) @@ -43,6 +45,7 @@ void ff_big_add(BigInt *b, uint8_t a) c >>= XFACE_BITSPERWORD; } if (i == b->nb_words && c) { + av_assert0(b->nb_words < XFACE_MAX_WORDS); b->nb_words++; *w = c & XFACE_WORDMASK; } @@ -98,6 +101,7 @@ void ff_big_mul(BigInt *b, uint8_t a) return; if (a == 0) { /* treat this as a == WORDCARRY and just shift everything left a WORD */ + av_assert0(b->nb_words < XFACE_MAX_WORDS); i = b->nb_words++; w = b->words + i; while (i--) { @@ -116,6 +120,7 @@ void ff_big_mul(BigInt *b, uint8_t a) c >>= XFACE_BITSPERWORD; } if (c) { + av_assert0(b->nb_words < XFACE_MAX_WORDS); b->nb_words++; *w = c & XFACE_WORDMASK; }