Skip to content

Commit

Permalink
Fix use of uninitialized variables in DVDCodecs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Hill committed Sep 1, 2012
1 parent 9e2b37d commit 4dbacda
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 9 deletions.
Expand Up @@ -45,6 +45,7 @@ CDVDAudioCodecFFmpeg::CDVDAudioCodecFFmpeg() : CDVDAudioCodec()
m_bLpcmMode = false;

m_pFrame1 = NULL;
m_iSampleFormat = AV_SAMPLE_FMT_NONE;
}

CDVDAudioCodecFFmpeg::~CDVDAudioCodecFFmpeg()
Expand Down
1 change: 0 additions & 1 deletion xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.h
Expand Up @@ -50,7 +50,6 @@ class CDVDAudioCodecFFmpeg : public CDVDAudioCodec
AVAudioConvert* m_pConvert;
enum AVSampleFormat m_iSampleFormat;
CAEChannelInfo m_channelLayout;
int m_iMapChannels;
bool m_bLpcmMode;

AVFrame* m_pFrame1;
Expand Down
1 change: 1 addition & 0 deletions xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecLPcm.cpp
Expand Up @@ -26,6 +26,7 @@ CDVDAudioCodecLPcm::CDVDAudioCodecLPcm() : CDVDAudioCodecPcm()
{
m_codecID = CODEC_ID_NONE;
m_bufferSize = LPCM_BUFFER_SIZE;
memset(m_buffer, 0, sizeof(m_buffer));
}

bool CDVDAudioCodecLPcm::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options)
Expand Down
6 changes: 4 additions & 2 deletions xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPcm.cpp
Expand Up @@ -114,8 +114,11 @@ CDVDAudioCodecPcm::CDVDAudioCodecPcm() : CDVDAudioCodec()
m_iSourceSampleRate = 0;
m_iSourceBitrate = 0;
m_decodedDataSize = 0;
m_pInputBuffer = NULL;
m_codecID = CODEC_ID_NONE;
m_iOutputChannels = 0;

memset(m_decodedData, 0, sizeof(m_decodedData));
memset(table, 0, sizeof(table));
}

CDVDAudioCodecPcm::~CDVDAudioCodecPcm()
Expand Down Expand Up @@ -275,7 +278,6 @@ int CDVDAudioCodecPcm::GetData(BYTE** dst)

void CDVDAudioCodecPcm::SetDefault()
{
m_pInputBuffer = m_inputBuffer;
m_iSourceChannels = 0;
m_iSourceSampleRate = 0;
m_iSourceBitrate = 0;
Expand Down
3 changes: 0 additions & 3 deletions xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPcm.h
Expand Up @@ -42,9 +42,6 @@ class CDVDAudioCodecPcm : public CDVDAudioCodec
protected:
virtual void SetDefault();

BYTE m_inputBuffer[4096];
BYTE* m_pInputBuffer;

short m_decodedData[131072]; // could be a bit to big
int m_decodedDataSize;

Expand Down
1 change: 1 addition & 0 deletions xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayText.h
Expand Up @@ -43,6 +43,7 @@ class CDVDOverlayText : public CDVDOverlay
public:
CElement(ElementType type)
{
pNext = NULL;
m_type = type;
}

Expand Down
32 changes: 30 additions & 2 deletions xbmc/cores/dvdplayer/DVDCodecs/Video/CrystalHD.cpp
Expand Up @@ -269,6 +269,7 @@ CPictureBuffer::CPictureBuffer(ERenderFormat format, int width, int height)
m_color_range = 0;
m_color_matrix = 4;
m_format = format;
m_framerate = 0;

switch(m_format)
{
Expand Down Expand Up @@ -332,10 +333,20 @@ CMPCOutputThread::CMPCOutputThread(void *device, DllLibCrystalHD *dll, bool has_
m_timeout(20),
m_format_valid(false),
m_is_live_stream(false),
m_width(0),
m_height(0),
m_timestamp(0),
m_PictureNumber(0),
m_color_space(0),
m_color_range(0),
m_color_matrix(0),
m_interlace(0),
m_framerate_tracking(false),
m_framerate_cnt(0),
m_framerate_timestamp(0.0),
m_framerate(0.0)
m_framerate(0.0),
m_aspectratio_x(1),
m_aspectratio_y(1)
{
m_sw_scale_ctx = NULL;
m_dllSwScale = new DllSwScale;
Expand Down Expand Up @@ -1086,8 +1097,25 @@ CCrystalHD::CCrystalHD() :
m_has_bcm70015(false),
m_color_space(BCM::MODE420),
m_drop_state(false),
m_pOutputThread(NULL)
m_skip_state(false),
m_timeout(0),
m_wait_timeout(0),
m_field(0),
m_width(0),
m_height(0),
m_reset(0),
m_last_pict_num(0),
m_last_demuxer_pts(0.0),
m_last_decoder_pts(0.0),
m_pOutputThread(NULL),
m_sps_pps_size(0),
m_convert_bitstream(false)
{
#if (HAVE_LIBCRYSTALHD == 2)
memset(&m_bc_info_crystal, 0, sizeof(m_bc_info_crystal));
#endif

memset(&m_chd_params, 0, sizeof(m_chd_params));

m_dll = new DllLibCrystalHD;
#ifdef _WIN32
Expand Down
Expand Up @@ -40,7 +40,8 @@ CDVDVideoCodecCrystalHD::CDVDVideoCodecCrystalHD() :
m_Codec(NULL),
m_DropPictures(false),
m_Duration(0.0),
m_pFormatName("")
m_pFormatName(""),
m_CodecType(CRYSTALHD_CODEC_ID_MPEG2)
{
}

Expand Down
Expand Up @@ -137,6 +137,7 @@ CDVDVideoCodecFFmpeg::CDVDVideoCodecFFmpeg() : CDVDVideoCodec()

m_iScreenWidth = 0;
m_iScreenHeight = 0;
m_iOrientation = 0;
m_bSoftware = false;
m_pHardware = NULL;
m_iLastKeyframe = 0;
Expand Down
Expand Up @@ -63,6 +63,7 @@ CDVDVideoCodecLibMpeg2::CDVDVideoCodecLibMpeg2()
m_irffpattern = 0;
m_bFilm = false;
m_bIs422 = false;
m_hurry = 0;
m_dts = DVD_NOPTS_VALUE;
m_dts2 = DVD_NOPTS_VALUE;
}
Expand Down
1 change: 1 addition & 0 deletions xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoPPFFmpeg.cpp
Expand Up @@ -28,6 +28,7 @@ CDVDVideoPPFFmpeg::CDVDVideoPPFFmpeg(const CStdString& mType)
m_pMode = m_pContext = NULL;
m_pSource = m_pTarget = NULL;
m_iInitWidth = m_iInitHeight = 0;
m_deinterlace = false;
memset(&m_FrameBuffer, 0, sizeof(DVDVideoPicture));
}
CDVDVideoPPFFmpeg::~CDVDVideoPPFFmpeg()
Expand Down
1 change: 1 addition & 0 deletions xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp
Expand Up @@ -149,6 +149,7 @@ CDecoder::CDecoder()
m_config = 0;
m_context = 0;
m_hwaccel = (vaapi_context*)calloc(1, sizeof(vaapi_context));
memset(m_surfaces, 0, sizeof(*m_surfaces));
}

CDecoder::~CDecoder()
Expand Down

0 comments on commit 4dbacda

Please sign in to comment.