From e6a08aabf012856a890b2428ba5f0b7bbf9a5443 Mon Sep 17 00:00:00 2001 From: oscar Date: Mon, 28 Mar 2022 04:12:15 -0400 Subject: [PATCH] fix debugging issue --- ffmpeg/extras.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ffmpeg/extras.c b/ffmpeg/extras.c index bd4a05f12f..e7dcd33ee2 100644 --- a/ffmpeg/extras.c +++ b/ffmpeg/extras.c @@ -234,7 +234,7 @@ static uint8_t * get_filebuffer(const char *filename, int* fileLength) *fileLength = get_filesize(filename); if(*fileLength > 0) { // Cast to float is necessary to avoid int division - paddedLength = ceil(*fileLength / (float)AV_INPUT_BUFFER_PADDING_SIZE)*AV_INPUT_BUFFER_PADDING_SIZE + AV_INPUT_BUFFER_PADDING_SIZE; + paddedLength = (int)((*fileLength / (float)AV_INPUT_BUFFER_PADDING_SIZE)+1)*AV_INPUT_BUFFER_PADDING_SIZE + AV_INPUT_BUFFER_PADDING_SIZE; buffer = (uint8_t*)av_calloc(paddedLength, sizeof(uint8_t)); if (!buffer) { av_log(NULL, AV_LOG_ERROR, "Could not allocate memory for reading signature file\n");