summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-01-27 22:21:55 +0100
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-01-27 22:21:55 +0100
commit96b6ac7d509f59e85b2d72984e0e9d3ae94c37e0 (patch)
treef7e018ed4767a89998ceada1d39a282df2c5f52b
parente5e4ea99ece4f9a5f764673164e4f47438eb129a (diff)
wma: fixed crash when opening invalid wma files
-rw-r--r--plugins/wma/asfheader.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/plugins/wma/asfheader.c b/plugins/wma/asfheader.c
index 0001f334..db662103 100644
--- a/plugins/wma/asfheader.c
+++ b/plugins/wma/asfheader.c
@@ -392,18 +392,23 @@ static int asf_parse_header(DB_FILE *fd, asf_waveformatex_t* wfx, DB_playItem_t
{
asf_object_t current;
asf_object_t header;
- uint64_t datalen;
- int i;
+ uint64_t datalen = 0;
+ int i = 0;
int fileprop = 0;
- uint64_t play_duration;
- uint16_t flags;
- uint32_t subobjects;
+ uint64_t play_duration = 0;
+ uint16_t flags = 0;
+ uint32_t subobjects = 0;
uint8_t utf8buf[512];
int codectype = 0;
unsigned char id3buffer[2048];
unsigned char *id3buf = id3buffer;
int id3buf_remaining = sizeof(id3buffer);
+ memset (&current, 0, sizeof (current));
+ memset (&header, 0, sizeof (header));
+ memset (&utf8buf, 0, sizeof (utf8buf));
+ memset (&id3buffer, 0, sizeof (id3buffer));
+
asf_read_object_header((asf_object_t *) &header, fd);
DEBUGF("header.size=%d\n",(int)header.size);