From 8a2edb7053185f9dad31aa352271f4de48c40343 Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Sat, 4 Sep 2021 17:45:26 +0200 Subject: [PATCH] src/file_mp3.c: improve Frama-C annotations --- src/file_mp3.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/file_mp3.c b/src/file_mp3.c index f6fbb812..d8a6f450 100644 --- a/src/file_mp3.c +++ b/src/file_mp3.c @@ -265,11 +265,9 @@ static unsigned int search_MMT(const unsigned char *buffer, const unsigned int i /*@ @ requires buffer_size >= 32; - @ requires (buffer_size&1)==0; - @ requires \valid_read(buffer+(0..buffer_size-1)); - @ requires \valid(file_recovery); @ requires file_recovery->data_check==&data_check_mp3; - @ requires \separated(buffer + (..), file_recovery); + @ requires valid_data_check_param(buffer, buffer_size, file_recovery); + @ ensures valid_data_check_result(\result, file_recovery); @ ensures \result == DC_CONTINUE || \result == DC_STOP; @ assigns file_recovery->calculated_file_size; @*/ @@ -402,10 +400,9 @@ static data_check_t data_check_mp3(const unsigned char *buffer, const unsigned i /*@ @ requires buffer_size >= 32; - @ requires (buffer_size&1)==0; - @ requires \valid_read(buffer+(0..buffer_size-1)); - @ requires \valid(file_recovery); @ requires file_recovery->data_check==&data_check_id3; + @ requires valid_data_check_param(buffer, buffer_size, file_recovery); + @ ensures valid_data_check_result(\result, file_recovery); @ ensures \result == DC_CONTINUE || \result == DC_STOP; @ ensures file_recovery->data_check==&data_check_id3 || file_recovery->data_check==&data_check_mp3; @ assigns file_recovery->data_check, file_recovery->calculated_file_size;