int imagetoraw(opj_image_t * image, const char *outfile)
{
    return imagetoraw_common(image, outfile, OPJ_TRUE);
}

The product writes data past the end, or before the beginning, of the intended buffer.