From 43972b36ea34059311bb577d8944109be8a2bbb2 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 25 Jul 2023 09:32:02 +0200 Subject: [PATCH] fixed CIDs 4167{1,2,3,4,5,7,8} --- src/capture_filter/override_prop.c | 1 + src/utils/math.c | 5 +++-- src/video_capture/decklink.cpp | 2 +- src/video_capture/testcard2.c | 2 +- src/video_display/decklink.cpp | 6 ++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/capture_filter/override_prop.c b/src/capture_filter/override_prop.c index 27e3a740b..60434c148 100644 --- a/src/capture_filter/override_prop.c +++ b/src/capture_filter/override_prop.c @@ -174,4 +174,5 @@ static const struct capture_filter_info capture_filter_override_prop = { }; REGISTER_MODULE(override_prop, &capture_filter_override_prop, LIBRARY_CLASS_CAPTURE_FILTER, CAPTURE_FILTER_ABI_VERSION); +// coverity[leaked_storage:SUPPRESS] ADD_VO_PP_CAPTURE_FILTER_WRAPPER(override_prop, init, filter, done, vo_pp_set_out_buffer) diff --git a/src/utils/math.c b/src/utils/math.c index 868bcc308..fe9256370 100644 --- a/src/utils/math.c +++ b/src/utils/math.c @@ -81,6 +81,7 @@ next_power_of_two(unsigned long long x) if (x <= 1) { return 1; } - const unsigned long long pos = __builtin_clzll(x - 1); - return pos > 0 ? 1 << (sizeof(unsigned long long) * CHAR_BIT - pos) : 0; + const int pos = __builtin_clzll(x - 1); + return pos > 0 ? 1ULL << (sizeof(unsigned long long) * CHAR_BIT - pos) + : 0; } diff --git a/src/video_capture/decklink.cpp b/src/video_capture/decklink.cpp index b0cdeecdd..50a834962 100644 --- a/src/video_capture/decklink.cpp +++ b/src/video_capture/decklink.cpp @@ -207,7 +207,7 @@ class VideoDelegate : public IDeckLinkInputCallback { public: int newFrameReady{}; // -1 == timeout - BMDTimeValue frameTime; + BMDTimeValue frameTime{}; IDeckLinkVideoFrame *rightEyeFrame{}; void *pixelFrame{}; void *pixelFrameRight{}; diff --git a/src/video_capture/testcard2.c b/src/video_capture/testcard2.c index c761b5def..5d82f3eb2 100644 --- a/src/video_capture/testcard2.c +++ b/src/video_capture/testcard2.c @@ -330,7 +330,7 @@ void * vidcap_testcard2_thread(void *arg) gettimeofday(&s->last_audio_time, NULL); #ifdef HAVE_LIBSDL_TTF -#define EXIT_THREAD { exit_uv(1); s->should_exit = true; platform_sem_post(&s->semaphore); return NULL; } +#define EXIT_THREAD { free(banner); exit_uv(1); s->should_exit = true; platform_sem_post(&s->semaphore); return NULL; } TTF_Font * font = NULL; uint32_t *banner = malloc(vc_get_datalen(s->desc.width, BANNER_HEIGHT, RGBA)); if(TTF_Init() == -1) diff --git a/src/video_display/decklink.cpp b/src/video_display/decklink.cpp index ae1b437c2..f7a2a3385 100644 --- a/src/video_display/decklink.cpp +++ b/src/video_display/decklink.cpp @@ -143,7 +143,7 @@ class PlaybackDelegate : public IDeckLinkVideoOutputCallback // , public IDeckLi uint64_t frames_flushed = 0; uint64_t frames_late = 0; - IDeckLinkOutput *m_deckLinkOutput; + IDeckLinkOutput *m_deckLinkOutput{}; mutex schedLock; queue schedFrames{}; DeckLinkFrame *lastSchedFrame{}; @@ -1267,9 +1267,7 @@ static void *display_decklink_init(struct module *parent, const char *fmt, unsig break; } - if (deckLink != NULL) { - deckLink->Release(); - } + deckLink->Release(); dnum++; } deckLinkIterator->Release();