Accessing Multiple stream bufSurface

Hi, I am trying to access the surface list of NvBufSurface. I am only able to access the first element in the surfaceList. When I try to read surfaceList[1] elements it returns null.

Following is my code:

surface = (NvBufSurface *);  
    g_print("\nNumFilled: %d\n",surface->numFilled);
    g_print("\nSurface1 height: %d\n",surface->surfaceList[1].height);
        g_print("\nWhy don't you write?\n");
        g_print("\nIt won't write!\n");

I get the following output:

In cb_newpad
In cb_newpad
In cb_newpad
In cb_newpad
Creating LL OSD context new

NumFilled: 2

Surface1 height: 1080

It won't write!
OpenCV Error: Assertion failed (total() == 0 || data != __null) in Mat, file /u$
terminate called after throwing an instance of 'cv::Exception'
  what():  /usr/include/opencv2/core/mat.inl.hpp:500: error: (-215) total() == $