From ccf5d4cece5a916fb6ca3e2ad5250f342835dba2 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Thu, 11 Jun 2020 21:24:50 +1000 Subject: [PATCH] audiovisualwaveform: detect if the start index exceeds the buffer sample count Fixes segfault. --- app/audio/audiovisualwaveform.cpp | 5 +++ app/render/ShaderInfo.h | 4 +++ app/render/backend/opengl/openglshadercache.h | 34 ------------------- 3 files changed, 9 insertions(+), 34 deletions(-) create mode 100644 app/render/ShaderInfo.h delete mode 100644 app/render/backend/opengl/openglshadercache.h diff --git a/app/audio/audiovisualwaveform.cpp b/app/audio/audiovisualwaveform.cpp index 956bbe42a..bbad71e74 100644 --- a/app/audio/audiovisualwaveform.cpp +++ b/app/audio/audiovisualwaveform.cpp @@ -243,6 +243,11 @@ void AudioVisualWaveform::DrawSample(QPainter *painter, const QVector= samples.nb_samples()) { + return; + } + int next_sample_index = start_sample_index; int sample_index; diff --git a/app/render/ShaderInfo.h b/app/render/ShaderInfo.h new file mode 100644 index 000000000..a514845ca --- /dev/null +++ b/app/render/ShaderInfo.h @@ -0,0 +1,4 @@ +#ifndef SHADERINFO_H +#define SHADERINFO_H + +#endif // SHADERINFO_H diff --git a/app/render/backend/opengl/openglshadercache.h b/app/render/backend/opengl/openglshadercache.h deleted file mode 100644 index 27e4586e0..000000000 --- a/app/render/backend/opengl/openglshadercache.h +++ /dev/null @@ -1,34 +0,0 @@ -/*** - - Olive - Non-Linear Video Editor - Copyright (C) 2019 Olive Team - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -***/ - -#ifndef OPENGLSHADERCACHE_H -#define OPENGLSHADERCACHE_H - -#include - -#include "openglshader.h" - -OLIVE_NAMESPACE_ENTER - -using OpenGLShaderCache = QHash; - -OLIVE_NAMESPACE_EXIT - -#endif // OPENGLSHADERCACHE_H