thread: Code!
View Single Post
  #3  
01-17-2014, 11:57 PM
Phylum's Avatar
Phylum
No Artificial Colours
 
: Sep 2008
: Rock bottom
: 4,911
Blog Entries: 94
Rep Power: 23
Phylum  (5748)Phylum  (5748)Phylum  (5748)Phylum  (5748)Phylum  (5748)Phylum  (5748)Phylum  (5748)Phylum  (5748)Phylum  (5748)Phylum  (5748)Phylum  (5748)

The struct is defined by me. Pixels is an unsigned 32bit integer, big enough to hold up to 0xFFFFFFFF.

I just tacked the assignment back on without really thinking. The second printf() should have been down below that. The arrow in the dissasembly is stopped where the program segfaulted, at the assignment. You can clearly see that it's sandwiched between 2 calls to printf.

I'm pretty sure this is a byte alignment issue, but that's not something I've ever had to deal with before.

e: And yeah I realsied the output number of ~70,000,000 was way too small. That's why I'm thinking it might be alignment?

Last edited by Phylum; 01-18-2014 at 12:01 AM..
Reply With Quote