[easytag/wip/clang-analyzer: 2/14] Fix disc number tag writing for WavPack
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag/wip/clang-analyzer: 2/14] Fix disc number tag writing for WavPack
- Date: Mon, 12 Aug 2013 15:45:23 +0000 (UTC)
commit aaf340588f96b657e527942b810cf190d5b176b5
Author: David King <amigadave amigadave com>
Date: Sat Aug 10 22:53:46 2013 +0100
Fix disc number tag writing for WavPack
The track number was being used, which could lead to a NULL pointer
dereference. Found by the Clang static analyzer.
src/wavpack_tag.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/wavpack_tag.c b/src/wavpack_tag.c
index 48a13f5..43f1b86 100644
--- a/src/wavpack_tag.c
+++ b/src/wavpack_tag.c
@@ -330,8 +330,7 @@ gboolean Wavpack_Tag_Write_File_Tag (ET_File *ETFile)
buffer = g_strdup_printf ("%s/%s", FileTag->disc_number,
FileTag->disc_total);
- if (FileTag->track && WavpackAppendTagItem (wpc, "part", buffer,
- strlen (buffer)) == 0)
+ if (WavpackAppendTagItem (wpc, "part", buffer, strlen (buffer)) == 0)
{
g_free (buffer);
return FALSE;
@@ -343,9 +342,9 @@ gboolean Wavpack_Tag_Write_File_Tag (ET_File *ETFile)
}
else
{
- if (FileTag->track && WavpackAppendTagItem (wpc, "part",
- FileTag->disc_number,
- strlen (FileTag->disc_number)) == 0)
+ if (FileTag->disc_number && WavpackAppendTagItem (wpc, "part",
+ FileTag->disc_number,
+ strlen (FileTag->disc_number)) == 0)
{
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]