We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3454 - memory. double free or corrupted.
Summary: memory. double free or corrupted.
Status: RESOLVED INVALID
Alias: None
Product: SDL
Classification: Unclassified
Component: render (show other bugs)
Version: 2.0.4
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-14 20:28 UTC by Sakura
Modified: 2016-11-03 22:58 UTC (History)
1 user (show)

See Also:


Attachments
source code of my jpeg decoder with sdl2 (181.04 KB, application/x-rar)
2016-10-14 20:28 UTC, Sakura
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sakura 2016-10-14 20:28:02 UTC
Created attachment 2584 [details]
source code of my jpeg decoder with sdl2

If i include sdl into my jpeg decoder, some jpg's can not draw.

gcc *.c -lpthread -lm -I/usr/local/lib/ -lSDL2
./a.out 5in.jpg
Comment 1 Sylvain 2016-11-03 13:35:17 UTC
I think this can be closed ...

valgrind reports an issue in your code, when decoding the 5in.jpg:


malloc(3584) 0xa181c90
malloc(3584) 0xa182ae0
malloc(3584) 0xa183930
==14966== Invalid write of size 1
==14966==    at 0x109AE3: funcYCbCrToRGB (jpegStream.c:249)
==14966==    by 0x10AEDF: jsycbcrtorgb (jpegStream.c:664)
==14966==    by 0x10B6A0: main (main.c:110)
==14966==  Address 0xa182a9a is 0 bytes after a block of size 3,594 alloc'd
==14966==    at 0x4C2CB3F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==14966==    by 0x108E5C: my_malloc (common.c:13)
==14966==    by 0x10AE0D: jsycbcrtorgb (jpegStream.c:655)
==14966==    by 0x10B6A0: main (main.c:110)
Comment 2 Sam Lantinga 2016-11-03 22:58:44 UTC
Sylvain, thanks for investigating.

Sakura, please reopen this bug if your code runs cleanly under valgrind and you're still seeing this problem.