author | erik <erik> | 2007-02-08 01:45:16 (UTC) |
---|---|---|
committer | erik <erik> | 2007-02-08 01:45:16 (UTC) |
commit | 2e497f7cae45184184e2416114887095735958f5 (patch) (unidiff) | |
tree | a6b399d9bce5854dc7ad6c985b48965cf20680b0 /core/multimedia/opieplayer/vorbis/tremor/info.c | |
parent | 853b61f97e718359bef95147ab3c7beb0705acda (diff) | |
download | opie-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/multimedia/opieplayer/vorbis/tremor/info.c') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/vorbis/tremor/info.c | 2 |
1 files changed, 1 insertions, 1 deletions
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 | |||
@@ -84,34 +84,34 @@ int vorbis_comment_query_count(vorbis_comment *vc, char *tag){ | |||
84 | for(i=0;i<vc->comments;i++){ | 84 | for(i=0;i<vc->comments;i++){ |
85 | if(!tagcompare(vc->user_comments[i], fulltag, taglen)) | 85 | if(!tagcompare(vc->user_comments[i], fulltag, taglen)) |
86 | count++; | 86 | count++; |
87 | } | 87 | } |
88 | 88 | ||
89 | return count; | 89 | return count; |
90 | } | 90 | } |
91 | 91 | ||
92 | void vorbis_comment_clear(vorbis_comment *vc){ | 92 | void vorbis_comment_clear(vorbis_comment *vc){ |
93 | if(vc){ | 93 | if(vc){ |
94 | long i; | 94 | long i; |
95 | for(i=0;i<vc->comments;i++) | 95 | for(i=0;i<vc->comments;i++) |
96 | if(vc->user_comments[i])_ogg_free(vc->user_comments[i]); | 96 | if(vc->user_comments[i])_ogg_free(vc->user_comments[i]); |
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. |
105 | They may be equal, but short will never ge greater than long */ | 105 | They may be equal, but short will never ge greater than long */ |
106 | int vorbis_info_blocksize(vorbis_info *vi,int zo){ | 106 | int vorbis_info_blocksize(vorbis_info *vi,int zo){ |
107 | codec_setup_info *ci = (codec_setup_info *)vi->codec_setup; | 107 | codec_setup_info *ci = (codec_setup_info *)vi->codec_setup; |
108 | return ci ? ci->blocksizes[zo] : -1; | 108 | return ci ? ci->blocksizes[zo] : -1; |
109 | } | 109 | } |
110 | 110 | ||
111 | /* used by synthesis, which has a full, alloced vi */ | 111 | /* used by synthesis, which has a full, alloced vi */ |
112 | void vorbis_info_init(vorbis_info *vi){ | 112 | void vorbis_info_init(vorbis_info *vi){ |
113 | memset(vi,0,sizeof(*vi)); | 113 | memset(vi,0,sizeof(*vi)); |
114 | vi->codec_setup=(codec_setup_info *)_ogg_calloc(1,sizeof(codec_setup_info)); | 114 | vi->codec_setup=(codec_setup_info *)_ogg_calloc(1,sizeof(codec_setup_info)); |
115 | } | 115 | } |
116 | 116 | ||
117 | void vorbis_info_clear(vorbis_info *vi){ | 117 | void vorbis_info_clear(vorbis_info *vi){ |