[SERAPHIC][TIAF] StreamEventResponse with null data parameter will cause a null-pointer crash.
Test: atest android.media.tv.interactive.cts.TvInteractiveAppServiceTest Bug: 224877495 Change-Id: Iab7547f27bb2e2340e42ead981877d3a52055ad4
This commit is contained in:
parent
a725962d69
commit
a92a92fc62
@ -63,8 +63,12 @@ public final class StreamEventResponse extends BroadcastInfoResponse implements
|
||||
mEventId = source.readInt();
|
||||
mNptMillis = source.readLong();
|
||||
int dataLength = source.readInt();
|
||||
mData = new byte[dataLength];
|
||||
source.readByteArray(mData);
|
||||
if (dataLength > 0) {
|
||||
mData = new byte[dataLength];
|
||||
source.readByteArray(mData);
|
||||
} else {
|
||||
mData = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -100,7 +104,11 @@ public final class StreamEventResponse extends BroadcastInfoResponse implements
|
||||
super.writeToParcel(dest, flags);
|
||||
dest.writeInt(mEventId);
|
||||
dest.writeLong(mNptMillis);
|
||||
dest.writeInt(mData.length);
|
||||
dest.writeByteArray(mData);
|
||||
if (mData != null && mData.length > 0) {
|
||||
dest.writeInt(mData.length);
|
||||
dest.writeByteArray(mData);
|
||||
} else {
|
||||
dest.writeInt(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user