380148e3e68904555abc7b95b75885756a4112d8
[ Merge of http://go/wvgerrit/207457 ] When parsing Widevine's HLS key data, the key details are contained in a data URI in the HLS X-KEY URI field. The data of the URI is a base64 encoded JSON object, containing the information required to generate the license request. The "content_id" field of the JSON object is expected to be a base64 encoded; however, the HLS parser did not verify that the decoding was successful. In the event that was not successful, the decoder would return an empty string, which the parser would attempt to access the first element by reference which may be a null reference. In C++, creating a reference from a null point (without actually accessing the value) is undefined; however most C++ implemenations will not cause a segment fault; but it is not guarenteed by the standard. This change checks if the decoding was successful before attempting to store the decoded "content_id" value. A unit test is added to ensure that a parser fails gracefully. Bug: 356210640 Test: HlsParseTest.BadHlsData_InvalidContentId Change-Id: Ie2ad42d69953258659178dd1464d830b2723c6c7
Description
No description provided