[planetblupi] 18/61: Fix memleak by using a variable on the stack
Didier Raboud
odyx at moszumanska.debian.org
Thu Nov 2 19:24:52 UTC 2017
This is an automated email from the git hooks/post-receive script.
odyx pushed a commit to branch debian/master
in repository planetblupi.
commit 37da5b3b0708fd809353b78c258dfd28f78a7805
Author: Mathieu Schroeter <mathieu at schroetersa.ch>
Date: Sat Oct 21 18:41:53 2017 +0200
Fix memleak by using a variable on the stack
---
src/movie.cxx | 16 ++++++++--------
src/movie.h | 1 -
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/src/movie.cxx b/src/movie.cxx
index 3a8f3d8..7b22e84 100644
--- a/src/movie.cxx
+++ b/src/movie.cxx
@@ -108,21 +108,22 @@ CMovie::fileOpenMovie (const std::string & pFilename)
if (m_player == nullptr)
return false;
- pinfo = new Kit_PlayerInfo;
- Kit_GetPlayerInfo (m_player, pinfo);
+ Kit_PlayerInfo info;
+ Kit_GetPlayerInfo (m_player, &info);
SDL_AudioSpec wanted_spec, audio_spec;
SDL_memset (&wanted_spec, 0, sizeof (wanted_spec));
- wanted_spec.freq = pinfo->audio.samplerate;
- wanted_spec.format = pinfo->audio.format;
- wanted_spec.channels = pinfo->audio.channels;
+ wanted_spec.freq = info.audio.samplerate;
+ wanted_spec.format = info.audio.format;
+ wanted_spec.channels = info.audio.channels;
m_audioDev = SDL_OpenAudioDevice (nullptr, 0, &wanted_spec, &audio_spec, 0);
SDL_PauseAudioDevice (m_audioDev, 0);
m_videoTex = SDL_CreateTexture (
- g_renderer, pinfo->video.format, SDL_TEXTUREACCESS_STATIC,
- pinfo->video.width, pinfo->video.height);
+ g_renderer, info.video.format, SDL_TEXTUREACCESS_STATIC, info.video.width,
+ info.video.height);
+
if (m_videoTex == nullptr)
return false;
@@ -159,7 +160,6 @@ CMovie::CMovie ()
m_movie = nullptr;
m_player = nullptr;
m_videoTex = nullptr;
- pinfo = nullptr;
memset (m_audiobuf, 0, sizeof (m_audiobuf));
diff --git a/src/movie.h b/src/movie.h
index 31995b0..9c2f61d 100644
--- a/src/movie.h
+++ b/src/movie.h
@@ -52,7 +52,6 @@ protected:
bool initAVI ();
protected:
- Kit_PlayerInfo * pinfo;
Kit_Source * m_movie;
Kit_Player * m_player;
SDL_Texture * m_videoTex;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/planetblupi.git
More information about the Pkg-games-commits
mailing list