iSAC decoder: Don't read past the end of the buffer of encoded bytes
Bug: chromium:825524 Change-Id: Iff40a9fd62a34474af71b51dd3831a16412fbf3b Reviewed-on: https://webrtc-review.googlesource.com/66361 Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org> Commit-Queue: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22748}
This commit is contained in:
@ -1266,7 +1266,9 @@ static int Decode(ISACStruct* ISAC_main_inst,
|
|||||||
|
|
||||||
/* It might be less due to garbage. */
|
/* It might be less due to garbage. */
|
||||||
if ((numDecodedBytesUB != lenNextStream) &&
|
if ((numDecodedBytesUB != lenNextStream) &&
|
||||||
(numDecodedBytesUB != (lenNextStream -
|
(numDecodedBytesLB + 1 + numDecodedBytesUB >= lenEncodedBytes ||
|
||||||
|
numDecodedBytesUB !=
|
||||||
|
(lenNextStream -
|
||||||
encoded[numDecodedBytesLB + 1 + numDecodedBytesUB]))) {
|
encoded[numDecodedBytesLB + 1 + numDecodedBytesUB]))) {
|
||||||
instISAC->errorCode = ISAC_LENGTH_MISMATCH;
|
instISAC->errorCode = ISAC_LENGTH_MISMATCH;
|
||||||
return -1;
|
return -1;
|
||||||
|
Reference in New Issue
Block a user