PDA

View Full Version : Segmentation fault at glTexSubImage2D



kapil mehta
04-10-2016, 03:15 PM
I am trying to debug one segmentation fault. my application is in C++ with opengl for displaying .. once application is crashed i shoot bt command to see where is the issue:

PFA image for complete back trace of crash..
Backtrace doesnt give necesary information about crash it says crash is at glTexSubImage2D().. How do i further debug it ?

Any input is highly appreciated..

GClements
04-10-2016, 08:41 PM
Check the parameters to glTexSubImage(). A segfault typically indicates that either the pointer is incorrect (e.g. passing the address of a pointer rather than its value) or it doesn't point at sufficient memory based upon the values of the width, height, format and type parameters and the unpacking parameters set by glPixelStore() (in particular, GL_UNPACK_ALIGNMENT defaults to 4, which is a common pitfall).