diff --git a/lib_com/options.h b/lib_com/options.h index dadd57e9bd4738000b3e12f1a2be3f8cb9012880..9ca32b4b3fd70708afe1fbe1445478201ec13553 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -162,6 +162,7 @@ #define FIX_730_DPID_NOT_SET_CORRECTLY /* Eri: issue 730: write dpid read from file in correct index, print informative error message when DPID specified is not found. */ #define FIX_RAM_COUNTING_5MS_RENDERING /* FhG: fix for correct RAM reporting with 5ms rendering */ +#define FIX_786_ERROR_ISM_METADATA_READ /* VA: fix error reading past the last line of .csv metadata files */ /* #################### End BE switches ################################## */ diff --git a/lib_util/ism_file_reader.c b/lib_util/ism_file_reader.c index da47911d4c06896d1df2fbfde1798dd8b3a318a9..cd343957dbebd9c45e387cc2831af045909306f0 100644 --- a/lib_util/ism_file_reader.c +++ b/lib_util/ism_file_reader.c @@ -113,6 +113,19 @@ ivas_error IsmFileReader_readNextFrame( file = self->file; +#ifdef FIX_786_ERROR_ISM_METADATA_READ + while ( fgets( char_buff, META_LINE_LENGTH, file ) == NULL ) + { + if ( feof( self->file ) ) + { + rewind( self->file ); + } + else + { + return IVAS_ERR_FAILED_FILE_READ; + } + } +#else while ( feof( self->file ) ) { rewind( self->file ); @@ -122,6 +135,7 @@ ivas_error IsmFileReader_readNextFrame( { return IVAS_ERR_FAILED_FILE_READ; } +#endif char_ptr = strtok( char_buff, "," ); i = 0;