summaryrefslogtreecommitdiff
path: root/core
authorerik <erik>2007-02-08 01:45:16 (UTC)
committer erik <erik>2007-02-08 01:45:16 (UTC)
commit2e497f7cae45184184e2416114887095735958f5 (patch) (unidiff)
treea6b399d9bce5854dc7ad6c985b48965cf20680b0 /core
parent853b61f97e718359bef95147ab3c7beb0705acda (diff)
downloadopie-2e497f7cae45184184e2416114887095735958f5.zip
opie-2e497f7cae45184184e2416114887095735958f5.tar.gz
opie-2e497f7cae45184184e2416114887095735958f5.tar.bz2
Each file in this commit has a problem where it is possible to dereference
a pointer without that pointer being valid. This commit fixes each instance of that.
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/modplug/sndfile.cpp5
-rw-r--r--core/multimedia/opieplayer/vorbis/tremor/block.c6
-rw-r--r--core/multimedia/opieplayer/vorbis/tremor/info.c2
3 files changed, 9 insertions, 4 deletions
diff --git a/core/multimedia/opieplayer/modplug/sndfile.cpp b/core/multimedia/opieplayer/modplug/sndfile.cpp
index 1d0d610..799555c 100644
--- a/core/multimedia/opieplayer/modplug/sndfile.cpp
+++ b/core/multimedia/opieplayer/modplug/sndfile.cpp
@@ -1739,7 +1739,10 @@ BOOL CSoundFile::SetPatternName(UINT nPat, LPCSTR lpszName)
1739{ 1739{
1740 char szName[MAX_PATTERNNAME] = ""; // changed from CHAR 1740 char szName[MAX_PATTERNNAME] = ""; // changed from CHAR
1741 if (nPat >= MAX_PATTERNS) return FALSE; 1741 if (nPat >= MAX_PATTERNS) return FALSE;
1742 if (lpszName) lstrcpyn(szName, lpszName, MAX_PATTERNNAME); 1742 if (lpszName)
1743 lstrcpyn(szName, lpszName, MAX_PATTERNNAME);
1744 else
1745 return FALSE;
1743 szName[MAX_PATTERNNAME-1] = 0; 1746 szName[MAX_PATTERNNAME-1] = 0;
1744 if (!m_lpszPatternNames) m_nPatternNames = 0; 1747 if (!m_lpszPatternNames) m_nPatternNames = 0;
1745 if (nPat >= m_nPatternNames) 1748 if (nPat >= m_nPatternNames)
diff --git a/core/multimedia/opieplayer/vorbis/tremor/block.c b/core/multimedia/opieplayer/vorbis/tremor/block.c
index 8949253..7b5531b 100644
--- a/core/multimedia/opieplayer/vorbis/tremor/block.c
+++ b/core/multimedia/opieplayer/vorbis/tremor/block.c
@@ -226,8 +226,10 @@ void vorbis_dsp_clear(vorbis_dsp_state *v){
226 private_state *b=(private_state *)v->backend_state; 226 private_state *b=(private_state *)v->backend_state;
227 227
228 if(v->pcm){ 228 if(v->pcm){
229 for(i=0;i<vi->channels;i++) 229 if (vi) {
230 if(v->pcm[i])_ogg_free(v->pcm[i]); 230 for(i=0;i<vi->channels;i++)
231 if(v->pcm[i])_ogg_free(v->pcm[i]);
232 }
231 _ogg_free(v->pcm); 233 _ogg_free(v->pcm);
232 if(v->pcmret)_ogg_free(v->pcmret); 234 if(v->pcmret)_ogg_free(v->pcmret);
233 } 235 }
diff --git a/core/multimedia/opieplayer/vorbis/tremor/info.c b/core/multimedia/opieplayer/vorbis/tremor/info.c
index 941695e..3499ae4 100644
--- a/core/multimedia/opieplayer/vorbis/tremor/info.c
+++ b/core/multimedia/opieplayer/vorbis/tremor/info.c
@@ -97,8 +97,8 @@ void vorbis_comment_clear(vorbis_comment *vc){
97 if(vc->user_comments)_ogg_free(vc->user_comments); 97 if(vc->user_comments)_ogg_free(vc->user_comments);
98 if(vc->comment_lengths)_ogg_free(vc->comment_lengths); 98 if(vc->comment_lengths)_ogg_free(vc->comment_lengths);
99 if(vc->vendor)_ogg_free(vc->vendor); 99 if(vc->vendor)_ogg_free(vc->vendor);
100 memset(vc,0,sizeof(*vc));
100 } 101 }
101 memset(vc,0,sizeof(*vc));
102} 102}
103 103
104/* blocksize 0 is guaranteed to be short, 1 is guarantted to be long. 104/* blocksize 0 is guaranteed to be short, 1 is guarantted to be long.