Skip to content

Commit 95550d7

Browse files
Fix panic when prediction calculation is invalid (#282)
1 parent e70564b commit 95550d7

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
- name: Installing emulator and linker
5151
run: |
5252
sudo apt-get update
53-
sudo apt-get install qemu binfmt-support qemu-user-static gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
53+
sudo apt-get install qemu-system binfmt-support qemu-user-static gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
5454
5555
- name: Installing Rust toolchain
5656
uses: actions-rs/toolchain@v1

src/parser.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,12 @@ pub fn parse_sos<R: Read>(reader: &mut R, frame: &FrameInfo) -> Result<ScanInfo>
405405
let predictor_selection;
406406
let point_transform = successive_approximation_low;
407407

408+
if point_transform >= frame.precision {
409+
return Err(Error::Format(
410+
"invalid point transform, must be less than the frame precision".to_owned(),
411+
));
412+
}
413+
408414
if frame.coding_process == CodingProcess::DctProgressive {
409415
predictor_selection = Predictor::NoPrediction;
410416
if spectral_selection_end > 63 || spectral_selection_start > spectral_selection_end ||
3.77 KB
Loading

0 commit comments

Comments
 (0)