Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix panic when prediction calculation is invalid #282

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

strategy:
matrix:
Expand Down Expand Up @@ -39,7 +39,7 @@ jobs:
FEATURES: ${{ matrix.features }}

cross_compile_aarch64:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

strategy:
matrix:
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
FEATURES: ${{ matrix.features }}
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: aarch64-linux-gnu-gcc
cross_compile_wasm:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Install node
run: |
Expand Down
6 changes: 6 additions & 0 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,12 @@ pub fn parse_sos<R: Read>(reader: &mut R, frame: &FrameInfo) -> Result<ScanInfo>
let predictor_selection;
let point_transform = successive_approximation_low;

if point_transform >= frame.precision {
return Err(Error::Format(
"invalid point transform, must be less than the frame precision".to_owned(),
));
}

if frame.coding_process == CodingProcess::DctProgressive {
predictor_selection = Predictor::NoPrediction;
if spectral_selection_end > 63 || spectral_selection_start > spectral_selection_end ||
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading