func: int cmdutils_read_file(const char *filename,char **bufptr,size_t *size) FILE * f = fopen ( filename , "rb" ) ; if ( ! f )  fseek ( f , 0 , 2 ); * size = ( ftell ( f ) ); fseek ( f , 0 , 0 ); if ( * size == ( ( size_t ) ( - 1 ) ) )  fclose ( f ); * bufptr = ( av_malloc ( * size + 1 ) ); if ( ! ( * bufptr ) )  fclose ( f ); ret = ( fread ( ( * bufptr ) , 1 , * size , f ) ); if ( ret < * size )  av_free ( ( * bufptr ) ); if ( ferror ( f ) )  ( * bufptr ) [ ( * size ) ++ ] = '\0'; fclose ( f ); return ret ; 