@@ -821,7 +821,7 @@ static int memread( void* dest, const segy_file* fp, const void* src, size_t n )
821
821
return SEGY_OK ;
822
822
}
823
823
824
- static int memwrite ( segy_file * fp , void * dest , const void * src , size_t n ) {
824
+ static int memwrite ( segy_file * fp , void * dest , const void * src , size_t n ) { // cppcheck-suppress constParameterPointer
825
825
const void * begin = fp -> addr ;
826
826
const void * end = (const char * )fp -> addr + fp -> fsize ;
827
827
const void * destend = (const char * )dest + n ;
@@ -1897,7 +1897,7 @@ int segy_readsubtr( segy_file* fp,
1897
1897
*/
1898
1898
void * tracebuf = rangebuf ? rangebuf : malloc ( elems * elemsize );
1899
1899
1900
- const int readc = (int ) fread ( tracebuf , elemsize , elems , fp -> fp );
1900
+ const int readc = (int ) fread ( tracebuf , elemsize , elems , fp -> fp ); // cppcheck-suppress nullPointerOutOfMemory
1901
1901
if ( readc != elems ) {
1902
1902
if ( !rangebuf ) free ( tracebuf );
1903
1903
return SEGY_FREAD_ERROR ;
@@ -2013,7 +2013,7 @@ int segy_writesubtr( segy_file* fp,
2013
2013
*/
2014
2014
if ( !fp -> addr && (step == 1 || step == -1 ) && fp -> lsb ) {
2015
2015
void * tracebuf = rangebuf ? rangebuf : malloc ( elems * elemsize );
2016
- memcpy ( tracebuf , buf , elemsize * elems );
2016
+ memcpy ( tracebuf , buf , elemsize * elems ); // cppcheck-suppress nullPointerOutOfMemory
2017
2017
2018
2018
if (step == -1 ) reverse (tracebuf , elems , elemsize );
2019
2019
if (fp -> elemsize == 8 ) bswap64vec (tracebuf , elems );
@@ -2061,7 +2061,7 @@ int segy_writesubtr( segy_file* fp,
2061
2061
void * tracebuf = rangebuf ? rangebuf : malloc ( elems * elemsize );
2062
2062
2063
2063
// like in readsubtr, read a larger chunk and then step through that
2064
- const int readc = (int ) fread ( tracebuf , elemsize , elems , fp -> fp );
2064
+ const int readc = (int ) fread ( tracebuf , elemsize , elems , fp -> fp ); // cppcheck-suppress nullPointerOutOfMemory
2065
2065
if ( readc != elems ) { free ( tracebuf ); return SEGY_FREAD_ERROR ; }
2066
2066
/* rewind, because fread advances the file pointer */
2067
2067
err = fseek ( fp -> fp , - (elems * elemsize ), SEEK_CUR );
0 commit comments