avcodec/jpeg2000dec: Check remaining data in packed_headers_stream before use