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

Segmentation fault in sampleinterleavedlsscan.cpp:133 #37

Closed
seviezhou opened this issue Aug 4, 2020 · 3 comments
Closed

Segmentation fault in sampleinterleavedlsscan.cpp:133 #37

seviezhou opened this issue Aug 4, 2020 · 3 comments

Comments

@seviezhou
Copy link

System info

Ubuntu X64, gcc (Ubuntu 5.5.0-12ubuntu1), jpeg (latest master e52406)

Command line

./jpeg -oz -h -s 1x1,2x2,2x2 @@ /dev/null

Output

Segmentation fault

AddressSanitizer output

ASAN:SIGSEGV
=================================================================
==81357==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x0000005200b8 bp 0x7ffdd2f954b0 sp 0x7ffdd2f95110 T0)
    #0 0x5200b7 in SampleInterleavedLSScan::ParseMCU() /home/seviezhou/libjpeg/codestream/sampleinterleavedlsscan.cpp:133
    #1 0x45c4b4 in JPEG::ReadInternal(JPG_TagItem*) /home/seviezhou/libjpeg/interface/jpeg.cpp:345
    #2 0x45d5be in JPEG::Read(JPG_TagItem*) /home/seviezhou/libjpeg/interface/jpeg.cpp:210
    #3 0x42adbf in Reconstruct(char const*, char const*, int, char const*, bool) /home/seviezhou/libjpeg/cmd/reconstruct.cpp:121
    #4 0x4055f0 in main /home/seviezhou/libjpeg/cmd/main.cpp:718
    #5 0x7ff8b3e8083f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2083f)
    #6 0x409da8 in _start (/home/seviezhou/libjpeg/jpeg+0x409da8)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/seviezhou/libjpeg/codestream/sampleinterleavedlsscan.cpp:133 SampleInterleavedLSScan::ParseMCU()
==81357==ABORTING

POC

SEGV-ParseMCU-sampleinterleavedlsscan-133.zip

@thorfdbg
Copy link
Owner

Caused by pulling in the same component twice in the SOS marker. Fixed. Thank you.

@attritionorg
Copy link
Contributor

@thorfdbg I am trying to find where you fixed this and based on commits, it wasn't done in sampleinterleavedlsscan.cpp. Can you point to the fixing commit / where you implemented? Thanks!

@thorfdbg
Copy link
Owner

If this is about having two identical components in a scan, this issue was addressed in scan.cpp, lines 147 to 150.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants