Skip to content

Commit cdea7b1

Browse files
committed
Stricter mode check
1 parent 6801373 commit cdea7b1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/transform/FSDCodec.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,13 +329,17 @@ bool FSDCodec::inverse(SliceArray<byte>& input, SliceArray<byte>& output, int co
329329
dstIdx++;
330330
}
331331
}
332-
else { // mode == XOR_CODING
332+
else if (mode == XOR_CODING) {
333333
while (srcIdx < srcEnd) {
334334
dst[dstIdx] = src[srcIdx] ^ dst[dstIdx - dist];
335335
srcIdx++;
336336
dstIdx++;
337337
}
338338
}
339+
else {
340+
// Invalid mode
341+
return false;
342+
}
339343

340344
input._index += srcIdx;
341345
output._index += dstIdx;

0 commit comments

Comments
 (0)