Segmentation fault when capture a video from a file (avi 24-Bit RGB)

i am trying to play a video using opencv from a file but its giving seg-fault (which is 24-bit RGB , 640 x 480 Pixels) but same code is working fine for ( Divx mpeg-4 version 4 with 640 x 480) can anybody give me solution for this
i am using a code from here