I am trying to read an uncompressed AVI file - basic uncompressed AVI are BGR bitmaps.
if(frame.format == AV_PIX_FMT_BGR24){ int data_size = frame.linesize[0]*frame.height; my_data_ptr = new uint8_t [data_size]; memcpy(my_data_ptr, frame.data[0], data_size);}
I would expect frame.linesize[0]
to be width*3 but I find it is -width*3.
If manually set data_size
so it is not negative the memcpy results in a seg fault.
Are packed pixel formats stored in a special way ?