Approved-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* X-Face common data and utilities definition.
*/
* X-Face common data and utilities definition.
*/
+#include "libavutil/avassert.h"
+
#include "xface.h"
void ff_big_add(BigInt *b, uint8_t a)
#include "xface.h"
void ff_big_add(BigInt *b, uint8_t a)
c >>= XFACE_BITSPERWORD;
}
if (i == b->nb_words && c) {
c >>= XFACE_BITSPERWORD;
}
if (i == b->nb_words && c) {
+ av_assert0(b->nb_words < XFACE_MAX_WORDS);
b->nb_words++;
*w = c & XFACE_WORDMASK;
}
b->nb_words++;
*w = c & XFACE_WORDMASK;
}
return;
if (a == 0) {
/* treat this as a == WORDCARRY and just shift everything left a WORD */
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--) {
i = b->nb_words++;
w = b->words + i;
while (i--) {
c >>= XFACE_BITSPERWORD;
}
if (c) {
c >>= XFACE_BITSPERWORD;
}
if (c) {
+ av_assert0(b->nb_words < XFACE_MAX_WORDS);
b->nb_words++;
*w = c & XFACE_WORDMASK;
}
b->nb_words++;
*w = c & XFACE_WORDMASK;
}