mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Fix gif download error with mismatching slice byte length
Co-authored-by: Jamie Kyle <113370520+jamiebuilds-signal@users.noreply.github.com>
This commit is contained in:
@@ -126,13 +126,14 @@ async function fetchSegment(
|
||||
let slice: ArrayBufferView;
|
||||
// Trim duplicate bytes from start of last segment
|
||||
if (segmentRange.sliceStart > 0) {
|
||||
slice = new Uint8Array(data.buffer.slice(segmentRange.sliceStart));
|
||||
slice = data.slice(segmentRange.sliceStart);
|
||||
} else {
|
||||
slice = data;
|
||||
}
|
||||
strictAssert(
|
||||
slice.byteLength === segmentRange.sliceSize,
|
||||
'Slice buffer should be exact length of segment range slice'
|
||||
assertExpected(
|
||||
slice.byteLength,
|
||||
segmentRange.sliceSize,
|
||||
'Unexpected slice byte length'
|
||||
);
|
||||
return slice;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user