chromaprint-1.5.1-22.fc42

List of Findings

Error: COMPILER_WARNING (CWE-477): [#def1]
chromaprint-1.5.1-build/chromaprint-1.5.1/src/cmd/fpcalc.cpp:7: included_from: Included from here.
chromaprint-1.5.1-build/chromaprint-1.5.1/src/audio/ffmpeg_audio_reader.h: scope_hint: In member function ‘void chromaprint::FFmpegAudioReader::Close()’
chromaprint-1.5.1-build/chromaprint-1.5.1/src/audio/ffmpeg_audio_reader.h:223:30: warning[-Wdeprecated-declarations]: ‘int avcodec_close(AVCodecContext*)’ is deprecated
#  223 |                 avcodec_close(m_codec_ctx);
#      |                 ~~~~~~~~~~~~~^~~~~~~~~~~~~
chromaprint-1.5.1-build/chromaprint-1.5.1/src/audio/ffmpeg_audio_reader.h:18: included_from: Included from here.
/usr/include/ffmpeg/libavcodec/avcodec.h:2387:5: note: declared here
# 2387 | int avcodec_close(AVCodecContext *avctx);
#      |     ^~~~~~~~~~~~~
#  221|   
#  222|   	if (m_codec_ctx) {
#  223|-> 		avcodec_close(m_codec_ctx);
#  224|   		m_codec_ctx = nullptr;
#  225|   	}

Error: GCC_ANALYZER_WARNING: [#def2]
chromaprint-1.5.1-build/chromaprint-1.5.1/src/avresample/resample2.c: scope_hint: In function ‘av_resample_init’
chromaprint-1.5.1-build/chromaprint-1.5.1/src/avresample/avcodec.h:42:23: warning[-Wanalyzer-imprecise-fp-arithmetic]: use of floating-point arithmetic here might yield unexpected results
chromaprint-1.5.1-build/chromaprint-1.5.1/src/avresample/resample2.c:202:21: note: in expansion of macro ‘av_mallocz’
chromaprint-1.5.1-build/chromaprint-1.5.1/src/avresample/resample2.c:202:21: note: in expansion of macro ‘av_mallocz’
chromaprint-1.5.1-build/chromaprint-1.5.1/src/avresample/avcodec.h:42:23: note: only use operands of an integer type inside the size argument
chromaprint-1.5.1-build/chromaprint-1.5.1/src/avresample/resample2.c:202:21: note: in expansion of macro ‘av_mallocz’
#   40|   typedef void *AVClass;
#   41|   
#   42|-> #define av_mallocz(l) calloc(1, (l))
#   43|   #define av_malloc(l) malloc(l)
#   44|   #define av_realloc(p,l) realloc((p),(l))

Error: GCC_ANALYZER_WARNING: [#def3]
chromaprint-1.5.1-build/chromaprint-1.5.1/src/avresample/resample2.c:28: included_from: Included from here.
chromaprint-1.5.1-build/chromaprint-1.5.1/src/avresample/resample2.c: scope_hint: In function ‘build_filter’
chromaprint-1.5.1-build/chromaprint-1.5.1/src/avresample/avcodec.h:43:22: warning[-Wanalyzer-imprecise-fp-arithmetic]: use of floating-point arithmetic here might yield unexpected results
chromaprint-1.5.1-build/chromaprint-1.5.1/src/avresample/resample2.c:102:19: note: in expansion of macro ‘av_malloc’
chromaprint-1.5.1-build/chromaprint-1.5.1/src/avresample/resample2.c:102:19: note: in expansion of macro ‘av_malloc’
chromaprint-1.5.1-build/chromaprint-1.5.1/src/avresample/avcodec.h:43:22: note: only use operands of an integer type inside the size argument
chromaprint-1.5.1-build/chromaprint-1.5.1/src/avresample/resample2.c:102:19: note: in expansion of macro ‘av_malloc’
#   41|   
#   42|   #define av_mallocz(l) calloc(1, (l))
#   43|-> #define av_malloc(l) malloc(l)
#   44|   #define av_realloc(p,l) realloc((p),(l))
#   45|   #define av_free(p) free(p)

Error: CPPCHECK_WARNING (CWE-758): [#def4]
chromaprint-1.5.1-build/chromaprint-1.5.1/src/avresample/resample2.c:281: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  279|   #else
#  280|           val = (val + (1<<(FILTER_SHIFT-1)))>>FILTER_SHIFT;
#  281|->         dst[dst_index] = (unsigned)(val + 32768) > 65535 ? (val>>31) ^ 32767 : val;
#  282|   #endif
#  283|   

Error: COMPILER_WARNING (CWE-457): [#def5]
chromaprint-1.5.1-build/chromaprint-1.5.1/src/chromaprint.cpp: scope_hint: In function ‘chromaprint_decode_fingerprint’
chromaprint-1.5.1-build/chromaprint-1.5.1/src/chromaprint.cpp:200:28: warning[-Wmaybe-uninitialized]: ‘algo’ may be used uninitialized
#  200 |                 *algorithm = algo;
#      |                 ~~~~~~~~~~~^~~~~~
chromaprint-1.5.1-build/chromaprint-1.5.1/src/chromaprint.cpp:187:13: note: ‘algo’ was declared here
#  187 |         int algo;
#      |             ^~~~
#  198|   	*size = int(uncompressed.size());
#  199|   	if (algorithm) {
#  200|-> 		*algorithm = algo;
#  201|   	}
#  202|   	std::copy(uncompressed.begin(), uncompressed.end(), *fp);

Error: COMPILER_WARNING (CWE-477): [#def6]
chromaprint-1.5.1-build/chromaprint-1.5.1/src/fft_lib_avfft.cpp: scope_hint: In constructor ‘chromaprint::FFTLib::FFTLib(size_t)’
chromaprint-1.5.1-build/chromaprint-1.5.1/src/fft_lib_avfft.cpp:17:34: warning[-Wdeprecated-declarations]: ‘RDFTContext* av_rdft_init(int, RDFTransformType)’ is deprecated
#   17 |         m_rdft_ctx = av_rdft_init(bits, DFT_R2C);
#      |                      ~~~~~~~~~~~~^~~~~~~~~~~~~~~
chromaprint-1.5.1-build/chromaprint-1.5.1/src/fft_lib_avfft.h:9: included_from: Included from here.
chromaprint-1.5.1-build/chromaprint-1.5.1/src/fft_lib_avfft.cpp:4: included_from: Included from here.
/usr/include/ffmpeg/libavcodec/avfft.h:108:14: note: declared here
#  108 | RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans);
#      |              ^~~~~~~~~~~~
#   15|   		frame_size >>= 1;
#   16|   	}
#   17|-> 	m_rdft_ctx = av_rdft_init(bits, DFT_R2C);
#   18|   }
#   19|   

Error: COMPILER_WARNING (CWE-477): [#def7]
chromaprint-1.5.1-build/chromaprint-1.5.1/src/fft_lib_avfft.cpp: scope_hint: In destructor ‘chromaprint::FFTLib::~FFTLib()’
chromaprint-1.5.1-build/chromaprint-1.5.1/src/fft_lib_avfft.cpp:21:20: warning[-Wdeprecated-declarations]: ‘void av_rdft_end(RDFTContext*)’ is deprecated
#   21 |         av_rdft_end(m_rdft_ctx);
#      |         ~~~~~~~~~~~^~~~~~~~~~~~
/usr/include/ffmpeg/libavcodec/avfft.h:112:6: note: declared here
#  112 | void av_rdft_end(RDFTContext *s);
#      |      ^~~~~~~~~~~
#   19|   
#   20|   FFTLib::~FFTLib() {
#   21|-> 	av_rdft_end(m_rdft_ctx);
#   22|   	av_free(m_input);
#   23|   	av_free(m_window);

Error: COMPILER_WARNING (CWE-477): [#def8]
chromaprint-1.5.1-build/chromaprint-1.5.1/src/fft_lib_avfft.cpp: scope_hint: In member function ‘void chromaprint::FFTLib::Compute(chromaprint::FFTFrame&)’
chromaprint-1.5.1-build/chromaprint-1.5.1/src/fft_lib_avfft.cpp:34:21: warning[-Wdeprecated-declarations]: ‘void av_rdft_calc(RDFTContext*, FFTSample*)’ is deprecated
#   34 |         av_rdft_calc(m_rdft_ctx, m_input);
#      |         ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/usr/include/ffmpeg/libavcodec/avfft.h:110:6: note: declared here
#  110 | void av_rdft_calc(RDFTContext *s, FFTSample *data);
#      |      ^~~~~~~~~~~~
#   32|   
#   33|   void FFTLib::Compute(FFTFrame &frame) {
#   34|-> 	av_rdft_calc(m_rdft_ctx, m_input);
#   35|   	auto input = m_input;
#   36|   	auto output = frame.begin();

Error: COMPILER_WARNING (CWE-563): [#def9]
chromaprint-1.5.1-build/chromaprint-1.5.1/src/utils/base64.cpp: scope_hint: In function ‘void chromaprint::Base64Encode(const std::string&, std::string&)’
chromaprint-1.5.1-build/chromaprint-1.5.1/src/utils/base64.cpp:12:20: warning[-Wunused-but-set-variable]: variable ‘end’ set but not used
#   12 |         const auto end = Base64Encode(src.cbegin(), src.cend(), dest.begin());
#      |                    ^~~
#   10|   {
#   11|   	dest.resize(GetBase64EncodedSize(src.size()));
#   12|-> 	const auto end = Base64Encode(src.cbegin(), src.cend(), dest.begin());
#   13|   	assert(dest.end() == end);
#   14|   }

Error: COMPILER_WARNING (CWE-563): [#def10]
chromaprint-1.5.1-build/chromaprint-1.5.1/src/utils/base64.cpp: scope_hint: In function ‘void chromaprint::Base64Decode(const std::string&, std::string&)’
chromaprint-1.5.1-build/chromaprint-1.5.1/src/utils/base64.cpp:26:20: warning[-Wunused-but-set-variable]: variable ‘end’ set but not used
#   26 |         const auto end = Base64Decode(src.cbegin(), src.cend(), dest.begin());
#      |                    ^~~
#   24|   {
#   25|   	dest.resize(GetBase64DecodedSize(src.size()));
#   26|-> 	const auto end = Base64Decode(src.cbegin(), src.cend(), dest.begin());
#   27|   	assert(dest.end() == end);
#   28|   }

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-91.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namechromaprint-1.5.1-22.fc42
store-results-to/tmp/tmpv5unf7aa/chromaprint-1.5.1-22.fc42.tar.xz
time-created2024-11-12 23:20:06
time-finished2024-11-12 23:21:33
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpv5unf7aa/chromaprint-1.5.1-22.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpv5unf7aa/chromaprint-1.5.1-22.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9