[Datatype-cvs] flash/flashhost flash_guest_player_ns.cpp,1.60,1.61
sfu at helixcommunity.org sfu at helixcommunity.orgUpdate of /cvsroot/datatype/flash/flashhost
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv26843
Modified Files:
flash_guest_player_ns.cpp
Log Message:
bug 217200 fix, check 'FLV' header magic number to block h.264 FLV
Index: flash_guest_player_ns.cpp
===================================================================
RCS file: /cvsroot/datatype/flash/flashhost/flash_guest_player_ns.cpp,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- flash_guest_player_ns.cpp 10 May 2008 20:52:30 -0000 1.60
+++ flash_guest_player_ns.cpp 14 May 2008 16:25:08 -0000 1.61
@@ -4753,6 +4753,31 @@
rSize.cx = cSWFHdr.GetWidthInPixels();
rSize.cy = cSWFHdr.GetHeightInPixels();
}
+ else
+ {
+ // It should be a FLV file with 'FLV' header magic, if not
+ // error out.
+ // TODO: we may decide to actually parse the FLV to get to some
+ // header information
+ pBuf = pBuffer->GetBuffer();
+ if (pBuf[0] == 'F' && pBuf[1] == 'L' && pBuf[2] == 'V')
+ {
+ retVal = HXR_OK;
+ }
+ else
+ {
+ // header parsing error, not a supported Flash file
+ IHXBuffer* pErrMsg = NULL;
+ CreateBufferCCF(pErrMsg, m_pContext);
+ if (pErrMsg)
+ {
+ const char* errMsg = "";
+ pErrMsg->Set((UINT8*)errMsg, strlen(errMsg)+1);
+ CallAllResponseError(HXR_INVALID_FILE, pErrMsg);
+ HX_RELEASE(pErrMsg);
+ }
+ }
+ }
}
return retVal;