Skip to content

Commit

Permalink
Merge pull request #10018 from mapfau/memleak
Browse files Browse the repository at this point in the history
VIdeoPlayer: Fix double mem alloation if streamcodec hasn't changed
  • Loading branch information
FernetMenta committed Jun 21, 2016
2 parents e8e6c2a + ce35ff9 commit 7b8e691
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ void CDVDDemuxClient::RequestStreams()
streamAudio->iBitsPerSample = source->iBitsPerSample;
if (source->ExtraSize > 0 && source->ExtraData)
{
delete[] streamAudio->ExtraData;
streamAudio->ExtraData = new uint8_t[source->ExtraSize];
streamAudio->ExtraSize = source->ExtraSize;
for (unsigned int j=0; j<source->ExtraSize; j++)
Expand Down Expand Up @@ -424,6 +425,7 @@ void CDVDDemuxClient::RequestStreams()
streamVideo->stereo_mode = "mono";
if (source->ExtraSize > 0 && source->ExtraData)
{
delete[] streamVideo->ExtraData;
streamVideo->ExtraData = new uint8_t[source->ExtraSize];
streamVideo->ExtraSize = source->ExtraSize;
for (unsigned int j=0; j<source->ExtraSize; j++)
Expand Down Expand Up @@ -458,6 +460,7 @@ void CDVDDemuxClient::RequestStreams()

if (source->ExtraSize == 4)
{
delete[] streamSubtitle->ExtraData;
streamSubtitle->ExtraData = new uint8_t[4];
streamSubtitle->ExtraSize = 4;
for (int j=0; j<4; j++)
Expand Down

0 comments on commit 7b8e691

Please sign in to comment.