[Datatype-cvs] flac/fileformat flacfformat.cpp,1.2.4.3,1.2.4.4
kliu at helixcommunity.org kliu at helixcommunity.orgUpdate of /cvsroot/datatype/flac/fileformat
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv24711
Modified Files:
Tag: hxclient_3_6_1_atlas
flacfformat.cpp
Log Message:
Modified by: kliu at real.com
Date: 09/17/2010
Project: RealPlayer for Android Smartphones
Synopsis: Fixing FLAC potential seg fault bug
Overview: It's possible that read is not successful and pBuffer passed into ReadDone is NULL. When that case happens, the pBuffer->GetBuffer() statement following will cause seg fault. As a fix, we will check the status passed in. If it's not HXR_OK, we will not execute the code that will cause seg fault and will let the code following report error.
Files Modified:
datatype/flac/flacfformat.cpp
Image Size and Heap Use impact (Client -Only):
None
Platforms and Profiles Affected:
Platform: android-2.2-arm-qsd_8650a
Profile: helix-client-android-full
Distribution Libraries Affected:
None
Distribution library impact and planned action:
None
Platforms and Profiles Build Verified:
Platform: android-2.2-arm-qsd_8650a
Profile: helix-client-android-full
Platforms and Profiles Functionality verified:
Platform: android-2.2-arm-qsd_8650a
Profile: helix-client-android-full
Branch: HEAD, 310atlas, 361atlas, 362atlas, 363atlas
Copyright assignment: I am a RealNetworks employee or contractor
Index: flacfformat.cpp
===================================================================
RCS file: /cvsroot/datatype/flac/fileformat/flacfformat.cpp,v
retrieving revision 1.2.4.3
retrieving revision 1.2.4.4
diff -u -d -r1.2.4.3 -r1.2.4.4
--- flacfformat.cpp 17 Sep 2010 08:08:25 -0000 1.2.4.3
+++ flacfformat.cpp 19 Sep 2010 02:33:01 -0000 1.2.4.4
@@ -508,6 +508,8 @@
IHXPacket* pPacket = NULL;
frame_header header;
+ if (HXR_OK != status)
+ {
pData = pBuffer->GetBuffer();
ulDataSize = pBuffer->GetSize();
@@ -515,8 +517,10 @@
{
delete m_pBitstream;
}
+
m_pBitstream = new Bitstream();
m_pBitstream->SetBuffer(pData, ulDataSize);
+ }
switch(m_PluginState)
{