Giter VIP home page Giter VIP logo

pnglite's People

Contributors

dankar avatar mindjiver avatar siegelord avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pnglite's Issues

Segfault when using png_get_data()

Maybe I did something stupid, but I can't find an obvious error:

#include "pnglite/pnglite.h"
unsigned char IMG_BUFFER[1152000]; // 1152000 = 480 * 800 * 3

int main(int argc, char* argv[]) {
  png_t png;
  png_open_file_read(&png, "white.png");
  png_get_data(&png, IMG_BUFFER);
  return 0;
}

compile: gcc -Wall -g -o minimal minimal.c pnglite/pnglite.c -lz

This leads to a SIGSEGV, valgrind output:

==921== Jump to the invalid address stated on the next line
==921==    at 0x0: ???
==921==    by 0x40258F: png_get_data (pnglite.c:777)
==921==    by 0x400CFC: main (minimal.c:7)
==921==  Address 0x0 is not stack'd, malloc'd or (recently) free'd

Compiler: gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2
Arch: x86_64
Uname -sriv: Linux 3.5.0-37-generic #58-Ubuntu SMP Mon Jul 8 22:07:55 UTC 2013 x86_64

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.