CEC: Do null/empty check against the parameter for checkRecordSource()

This prevents out-of-bound exception from occurring.

Bug: 19188370
Change-Id: I051dccf7760cb542ea3dc9b0adc9625fa2ad8b1f
This commit is contained in:
Jinsuk Kim
2015-01-29 16:28:37 +09:00
parent 26faa0be67
commit c8aaaef20f

View File

@@ -759,6 +759,8 @@ public final class HdmiRecordSources {
*/
@SystemApi
public static boolean checkRecordSource(byte[] recordSource) {
if (recordSource == null || recordSource.length == 0) return false;
int recordSourceType = recordSource[0];
int extraDataSize = recordSource.length - 1;
switch (recordSourceType) {