From 7a9ceec6a5fbde5a1e2ca43cbe67269ee13bdab8 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sun, 16 Oct 2011 16:03:23 +0200 Subject: [PATCH] Matroska & WAVPACK: fix more uninitialized variables --- src/common/wavpack.cpp | 9 +++++++++ src/common/wavpack.h | 10 ++++++---- src/input/r_matroska.h | 1 + 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/common/wavpack.cpp b/src/common/wavpack.cpp index 22691e0cf..732417f34 100644 --- a/src/common/wavpack.cpp +++ b/src/common/wavpack.cpp @@ -22,6 +22,15 @@ const uint32_t sample_rates [] = { 6000, 8000, 9600, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000, 192000 }; +wavpack_meta_t::wavpack_meta_t() + : channel_count(0) + , bits_per_sample(0) + , sample_rate(0) + , samples_per_block(0) + , has_correction(false) +{ +} + static void little_endian_to_native(void *data, const char *format) { diff --git a/src/common/wavpack.h b/src/common/wavpack.h index 17c0c9244..1e28f5a5c 100644 --- a/src/common/wavpack.h +++ b/src/common/wavpack.h @@ -24,7 +24,7 @@ #if defined(COMP_MSC) #pragma pack(push,1) #endif -typedef struct PACKED_STRUCTURE { +struct PACKED_STRUCTURE wavpack_header_t { char ck_id [4]; // "wvpk" uint32_t ck_size; // size of entire frame (minus 8, of course) uint16_t version; // 0x403 for now @@ -35,18 +35,20 @@ typedef struct PACKED_STRUCTURE { uint32_t block_samples; // # samples in this block uint32_t flags; // various flags for id and decoding uint32_t crc; // crc for actual decoded data -} wavpack_header_t; +}; #if defined(COMP_MSC) #pragma pack(pop) #endif -typedef struct { +struct wavpack_meta_t { int channel_count; int bits_per_sample; uint32_t sample_rate; uint32_t samples_per_block; bool has_correction; -} wavpack_meta_t; + + wavpack_meta_t(); +}; // or-values for "flags" diff --git a/src/input/r_matroska.h b/src/input/r_matroska.h index 2d10a6bf8..e6122ed4e 100644 --- a/src/input/r_matroska.h +++ b/src/input/r_matroska.h @@ -100,6 +100,7 @@ struct kax_track_t { , passthrough(false) , min_cache(0) , max_cache(0) + , max_blockadd_id(0) , lacing_flag(true) , default_duration(0) , v_width(0)