+ DWORD *pDwordData = (DWORD*) (This->image_data + stride * first_scanline); + DWORD *pDwordDataEnd = pDwordData + stride * max_rows;
I think you should use This->cinfo.output_scanline to determine the end pointer, since libjpeg can give us less data than we request.
Sorry for the delay, I have been dealing with some health problems lately.