This is definitely invalid. You can not know for sure if a nalu is 100% valid without parsing the entire thing. But you can sanity check values.
i_ref_idc is a 2 bit field. Anything outside the range of 0-3 is not sane.
i_type is 5 bits. But in reality an encoder will only produce 1-15 or 19-21 inclusive
b_long_startcode is boolean, so you cant sanity check it
i_first_mb and i_last_mb will be less then ceil(width/8.0) * ceil(height/8.0)
i_payload is the size, of the data p_payload point to, so pick a high value here. 10*with*height
should suffice.