Comments (3)
A test file would be helpful. At very least, it would be good to collect a full backtrace (i.e. run with RUST_BACKTRACE=1). The as_buffer
function intentionally doesn't validate its arguments since that is the responsibility of the caller
from image-tiff.
@fintelia I received a full backtrace yesterday from the user, but have yet to receive the test file. I will share it if I receive it. Hopefully this helps:
thread '<unnamed>' panicked at 'range start index 16380 out of range for slice of length 9660', /Users/davidlaxer/clamav-0.105.1/libclamav_rust/.cargo/vendor/tiff/src/decoder/mod.rs:131:72
stack backtrace:
0: rust_begin_unwind
at /rustc/e1e9319d93aea755c444c8f8ff863b0936d7a4b6/library/std/src/panicking.rs:517:5
1: core::panicking::panic_fmt
at /rustc/e1e9319d93aea755c444c8f8ff863b0936d7a4b6/library/core/src/panicking.rs:100:14
2: core::slice::index::slice_start_index_len_fail
at /rustc/e1e9319d93aea755c444c8f8ff863b0936d7a4b6/library/core/src/slice/index.rs:34:5
3: tiff::decoder::DecodingResult::as_buffer
4: tiff::decoder::Decoder<R>::read_image
at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/.cargo/vendor/tiff/src/decoder/mod.rs:1230:17
5: <image::codecs::tiff::TiffDecoder<R> as image::image::ImageDecoder>::read_image
at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/.cargo/vendor/image/./src/codecs/tiff.rs:222:15
6: image::image::decoder_to_vec
at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/.cargo/vendor/image/./src/image.rs:587:5
7: image::dynimage::decoder_to_image
at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/.cargo/vendor/image/./src/dynimage.rs:1025:23
8: image::dynimage::DynamicImage::from_decoder
at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/.cargo/vendor/image/./src/dynimage.rs:175:9
9: <image::io::free_functions::load_inner::LoadVisitor as image::io::free_functions::DecoderVisitor>::visit_decoder
at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/.cargo/vendor/image/./src/io/free_functions.rs:107:13
10: image::io::free_functions::load_decoder
at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/.cargo/vendor/image/./src/io/free_functions.rs:64:37
11: image::io::free_functions::load_inner
at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/.cargo/vendor/image/./src/io/free_functions.rs:111:5
12: image::io::free_functions::load
at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/.cargo/vendor/image/./src/io/free_functions.rs:37:5
13: image::dynimage::load_from_memory_with_format
at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/.cargo/vendor/image/./src/dynimage.rs:1221:5
14: image::dynimage::load_from_memory
at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/.cargo/vendor/image/./src/dynimage.rs:1206:5
15: clamav_rust::fuzzy_hash::fuzzy_hash_calculate_image
at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/src/fuzzy_hash.rs:412:20
16: fuzzy_hash_calculate_image
at /Users/davidlaxer/clamav-0.105.1/libclamav_rust/src/fuzzy_hash.rs:213:23
17: calculate_fuzzy_image_hash
at /Users/davidlaxer/clamav-0.105.1/libclamav/scanners.c:4088:10
18: cli_magic_scan
19: scan_common
at /Users/davidlaxer/clamav-0.105.1/libclamav/scanners.c:5419:14
20: cl_scandesc_callback
at /Users/davidlaxer/clamav-0.105.1/libclamav/scanners.c:5595:14
21: scanfile
at /Users/davidlaxer/clamav-0.105.1/clamscan/manager.c:411:16
22: scandirs
23: scandirs
24: scandirs
25: scandirs
26: scandirs
27: scandirs
28: scandirs
29: scandirs
30: scandirs
31: scandirs
32: scandirs
33: scandirs
34: scan_files
35: scanmanager
at /Users/davidlaxer/clamav-0.105.1/clamscan/manager.c:1625:15
36: main
at /Users/davidlaxer/clamav-0.105.1/clamscan/clamscan.c:171:11
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
fatal runtime error: failed to initiate panic, error 5
zsh: abort RUST_BACKTRACE=1 clamscan -r -i --bell --exclude-dir=/Users/davidlaxer/clamav
(ai) davidlaxer@x86_64-apple-darwin13 build %
from image-tiff.
@fintelia here is the sample file. I'll play with it a little as well to see if I can find a solution, but you're not doubt better equipped to solve it.
from image-tiff.
Related Issues (20)
- Unavailable Specification HOT 2
- TIFF files with unassociated extra samples are unsupported. HOT 2
- Please publish new version to resolve panics HOT 1
- Error: invalid code in LZW stream. HOT 2
- 16-bit-per-channel images using PackBits compression fail to load correctly. HOT 4
- Reading a larger tiff with PackBits fails if original reader is a bufreader, but worked in 0.7.1 HOT 2
- Encoding images in CMYKA HOT 1
- InconsistentSizesEncountered error reading Tiff with planar config HOT 3
- Grey scale image decoder color type : InterpretationWithBits(RGBPalette, [8]) HOT 1
- Tags of type Short are read as Unsigned HOT 3
- Multipage + Tile support HOT 5
- CMYKA decoding
- Decoding an image with missing required tag HOT 4
- Support Exif tags
- Very minor changes to allow multiband GeoTiff reading HOT 5
- Adding Bilevel support (Gray(1) ColorType) HOT 9
- Private fields and interfaces make file inspection difficult HOT 3
- OME-TIFF specification HOT 1
- Loading fails with "invalid code in LZW stream" HOT 1
- FormatError(StripTileTagConflict) with minimal example trying to write an image HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from image-tiff.